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. Each variable’s kind says what to send for it; see kinds of variables. Read this copy to build a send. Access requires templates:read. When has_draft is true, the template has changes that are not published yet. Get Template returns them. A template that was never published has content: null. Campaign templates have their own endpoints, and the ID of a campaign template answers 404 here.

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

The template's published copy

A transactional template, as one of its copies. Get Template and the answer of every template write give its working copy: its draft while it has one, and its published copy otherwise. Get Published Template and List Templates give its published copy, the one a send uses. has_draft says whether a draft exists.

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 this copy last changed

name
string
required

Template name, as it appears in the dashboard

subject
string
required

This copy's subject, set on the template page. Empty until one is set. A send uses the published subject, unless it names its own subject.

preheader
string
required

This copy's preview text, which a send of the published copy injects into the delivered HTML when it is set

variables
object[]
required

Every variable this copy's design uses. A send of this template uses the published copy's variables, which Get Published Template returns, and 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. Each variable's kind says what shape of value to send.

from
object | null
required

This copy's default sender. A send that names no from uses the published copy's. Null when the copy has none; a send of a published copy with none must name one.

Example:
reply_to
object | null
required

This copy's default reply-to address. A send that sets no reply-to, also one that names its own from, uses the published copy's. Null when the copy 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. A read or write answer of one item gives the design as AhaSend Markup (AhaML) in content.markup; a list does not. A write changes the design with content.markup.
  • 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 returns the draft while one exists.

content
object | null

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

markup_warnings
object[]

Warnings about the AhaML in content.markup, up to the first 100; empty when there are none. Present only in the answer to a write that carried content.markup.

Maximum array length: 100