Skip to main content
DELETE
AhaSend Go SDK
The AhaSend API discards the draft of a template. Access requires templates:write. The API and the dashboard edit the same draft, so this also discards changes made in the dashboard. A template with no draft stays as it is, so you can repeat the request safely. If the template changes in the dashboard or through another request while this request runs, the API tries again. If that continues, the API answers 503 with a Retry-After header. Retry the request after that delay.

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, with has_draft false

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.