Skip to main content
GET
AhaSend Go SDK
The AhaSend API returns the published copy of a template. Create Template Message sends this copy, and each recipient must give a value for every required name in variables. Access requires templates:read. When has_draft is true, the template has changes that are not published yet. To read them, use Get Template Draft. Campaign templates have their own endpoints, and the ID of a campaign template answers 404 here. To read one, use Get Campaign Template.

Authorizations

Authorization
string
header
required

API key for authentication. Non-empty Security Requirement values are AhaSend API-key roles. Roles listed within one requirement object are jointly required; separate requirement objects are alternatives.

Path Parameters

account_id
string<uuid>
required

Account ID

template_id
string<uuid>
required

Template ID

Response

Template

object
enum<string>
required

Object type identifier

Available options:
template
id
string<uuid>
required

Pass as template_id to Create Template Message to send this template

created_at
string<date-time>
required

When the template was created

updated_at
string<date-time>
required

When the template's name or published content last changed

name
string
required

Template name, as it appears in the dashboard

subject
string
required

The published subject, set on the template page. Empty until one is published, and overridden by a send that names its own subject.

preheader
string
required

The published preview text, injected into the delivered HTML when it is set

variables
object[]
required

Every variable the design uses. A send of this template takes the values only from each recipient's substitutions. Every recipient must give a value for each required variable; if one does not, the request is rejected and no message is sent.

from
object | null
required

The default sender, used by a send that names no from. Null when the template has none, and then every send must name one.

Example:
reply_to
object | null
required

The default reply-to address, used by a send that sets no reply-to, also one that names its own from. Null when the template has none. It has the shape of a send request's reply_to; its name is always empty.

Example:
editor
enum<string>
required

The editor the template is designed with. It never changes after the template is created.

  • advanced: designed in MJML, with the dashboard's advanced editor.
  • simple: designed with the dashboard's simple editor. Its HTML is made from the design and can be read but not changed through the API.
  • html: an HTML template, uploaded or written by hand.
Available options:
advanced,
simple,
html
has_draft
boolean
required

Whether the template has a draft, changes saved in the dashboard or through the API that are not published yet. Get Template Draft returns it.

content
object | null

The published content. Null when the published copy has no body, as for a template that was never published. List Templates leaves this field out; every other operation that returns a Template sets it.