API reference

Emails

Emails endpoints.

MethodPathSummary
POST/v1/account/email-assetsUpload an image for an email (PNG, JPEG or GIF, at most 1 MB)
GET/v1/account/emailsThe account's staff alerts: which it has changed, and any drafts
GET/v1/account/emails/callerThe caller emails a playbook can change, each with our default in force
GET/v1/account/emails/standardThe standard emails your people receive from us (read-only)
GET/v1/account/emails/standard/{key}/previewOne standard email as your people receive it, with sample values
GET/v1/account/emails/{key}One staff alert: the version in force, the draft, the history and the default
PUT/v1/account/emails/{key}/draftSave the draft of a staff alert (checked: placeholders, required parts, images)
DELETE/v1/account/emails/{key}/draftDiscard the draft of a staff alert
POST/v1/account/emails/{key}/keepKeep this version after our default changed ("Keep mine")
POST/v1/account/emails/{key}/previewRender a staff alert or caller email with sample values, in the brand that applies
POST/v1/account/emails/{key}/publishPublish the draft of a staff alert; it applies to the next send
POST/v1/account/emails/{key}/resetGo back to the layer below (the account’s version, or our default)
POST/v1/account/emails/{key}/testSend a test of an email, with sample values, to the addresses given or your own address
GET/v1/account/groups/{groupId}/emailsOne group's staff alerts: which it has its own version of
GET/v1/account/groups/{groupId}/emails/{key}One staff alert: the version in force, the draft, the history and the default
PUT/v1/account/groups/{groupId}/emails/{key}/draftSave the draft of a staff alert (checked: placeholders, required parts, images)
DELETE/v1/account/groups/{groupId}/emails/{key}/draftDiscard the draft of a staff alert
POST/v1/account/groups/{groupId}/emails/{key}/keepKeep this version after our default changed ("Keep mine")
POST/v1/account/groups/{groupId}/emails/{key}/publishPublish the draft of a staff alert; it applies to the next send
POST/v1/account/groups/{groupId}/emails/{key}/resetGo back to the layer below (the account’s version, or our default)

Upload an image for an email (PNG, JPEG or GIF, at most 1 MB)#

POST /v1/account/email-assets

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Response 201

FieldTypeRequiredDescription
urlstringYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/email-assets" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

The account's staff alerts: which it has changed, and any drafts#

GET /v1/account/emails

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Response 200

FieldTypeRequiredDescription
emailsarray<AccountEmailListItem>Yes—
emails[].customizedbooleanYes—
emails[].defaultUpdatedbooleanYes—
emails[].groupsCustomizedintegerYes—
emails[].hasDraftbooleanYes—
emails[].keyEmailKeyYes—
emails[].key.audienceenumYesOne of: "caller", "staff", "user", "internal".
emails[].key.defaultsEmailTemplateContentYes—
emails[].key.defaults.bodyanyYes—
emails[].key.defaults.preheaderstringNo—
emails[].key.defaults.subjectstringYes—
emails[].key.descriptionstringYes—
emails[].key.keystringYes—
emails[].key.labelstringYes—
emails[].key.linkOnlybooleanYes—
emails[].key.ownerenumYesOne of: "account", "platform".
emails[].key.placeholdersarray<EmailPlaceholder>Yes—
emails[].key.placeholders[].blockbooleanYes—
emails[].key.placeholders[].keystringYes—
emails[].key.placeholders[].labelstringYes—
emails[].key.placeholders[].personalbooleanYes—
emails[].key.placeholders[].urlbooleanYes—
emails[].key.requiredarray<string>Yes—
emails[].publishedVersioninteger | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X GET "$ANSWERSTACK_API_URL/v1/account/emails" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

The caller emails a playbook can change, each with our default in force#

GET /v1/account/emails/caller

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Response 200

FieldTypeRequiredDescription
emailsarray<object>Yes—
emails[].defaultEmailTemplateContentYes—
emails[].default.bodyanyYes—
emails[].default.preheaderstringNo—
emails[].default.subjectstringYes—
emails[].keyEmailKeyYes—
emails[].key.audienceenumYesOne of: "caller", "staff", "user", "internal".
emails[].key.defaultsEmailTemplateContentYes—
emails[].key.defaults.bodyanyYes—
emails[].key.defaults.preheaderstringNo—
emails[].key.defaults.subjectstringYes—
emails[].key.descriptionstringYes—
emails[].key.keystringYes—
emails[].key.labelstringYes—
emails[].key.linkOnlybooleanYes—
emails[].key.ownerenumYesOne of: "account", "platform".
emails[].key.placeholdersarray<EmailPlaceholder>Yes—
emails[].key.placeholders[].blockbooleanYes—
emails[].key.placeholders[].keystringYes—
emails[].key.placeholders[].labelstringYes—
emails[].key.placeholders[].personalbooleanYes—
emails[].key.placeholders[].urlbooleanYes—
emails[].key.requiredarray<string>Yes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X GET "$ANSWERSTACK_API_URL/v1/account/emails/caller" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

The standard emails your people receive from us (read-only)#

GET /v1/account/emails/standard

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Response 200

FieldTypeRequiredDescription
emailsarray<EmailKey>Yes—
emails[].audienceenumYesOne of: "caller", "staff", "user", "internal".
emails[].defaultsEmailTemplateContentYes—
emails[].defaults.bodyanyYes—
emails[].defaults.preheaderstringNo—
emails[].defaults.subjectstringYes—
emails[].descriptionstringYes—
emails[].keystringYes—
emails[].labelstringYes—
emails[].linkOnlybooleanYes—
emails[].ownerenumYesOne of: "account", "platform".
emails[].placeholdersarray<EmailPlaceholder>Yes—
emails[].placeholders[].blockbooleanYes—
emails[].placeholders[].keystringYes—
emails[].placeholders[].labelstringYes—
emails[].placeholders[].personalbooleanYes—
emails[].placeholders[].urlbooleanYes—
emails[].requiredarray<string>Yes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X GET "$ANSWERSTACK_API_URL/v1/account/emails/standard" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

One standard email as your people receive it, with sample values#

GET /v1/account/emails/standard/{key}/preview

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
keystringYesUp to 80 characters.

Response 200

FieldTypeRequiredDescription
htmlstringYes—
issuesarray<object>Yes—
issues[].messagestringYes—
issues[].patharray<string | number>Yes—
preheaderstringYes—
subjectstringYes—
textstringYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X GET "$ANSWERSTACK_API_URL/v1/account/emails/standard/{key}/preview" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

One staff alert: the version in force, the draft, the history and the default#

GET /v1/account/emails/{key}

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
keystringYesUp to 80 characters.

Response 200

FieldTypeRequiredDescription
defaultUpdatedany | nullYes—
draftany | nullYes—
historyarray<EmailVersion>Yes—
history[].contentany | nullYes—
history[].idstringYes—
history[].publishedAtstring (date-time) | nullYes—
history[].updatedAtstring (date-time)Yes—
history[].versioninteger | nullYes—
inheritedEmailTemplateContentYes—
inherited.bodyanyYes—
inherited.preheaderstringNo—
inherited.subjectstringYes—
inheritsFromenumYesOne of: "account", "default".
keyEmailKeyYes—
key.audienceenumYesOne of: "caller", "staff", "user", "internal".
key.defaultsEmailTemplateContentYes—
key.defaults.bodyanyYes—
key.defaults.preheaderstringNo—
key.defaults.subjectstringYes—
key.descriptionstringYes—
key.keystringYes—
key.labelstringYes—
key.linkOnlybooleanYes—
key.ownerenumYesOne of: "account", "platform".
key.placeholdersarray<EmailPlaceholder>Yes—
key.placeholders[].blockbooleanYes—
key.placeholders[].keystringYes—
key.placeholders[].labelstringYes—
key.placeholders[].personalbooleanYes—
key.placeholders[].urlbooleanYes—
key.requiredarray<string>Yes—
publishedany | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X GET "$ANSWERSTACK_API_URL/v1/account/emails/{key}" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Save the draft of a staff alert (checked: placeholders, required parts, images)#

PUT /v1/account/emails/{key}/draft

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
keystringYesUp to 80 characters.

Request body

application/json, required.

FieldTypeRequiredDescription
bodyobjectYes—
body.contentarray<object | object | object | object | object | object | object | object>YesUp to 200 items.
body.content[].attrsobjectNo(variant 1)
body.content[].attrs.alignmentenumNo(variant 1) One of: "left", "center", "right".
body.content[].contentarray<object | object | object>No(variant 1) Up to 200 items.
body.content[].content[].marksarray<object | object | object | object>No(variant 1) (variant 1) Up to 4 items.
body.content[].content[].textstringYes(variant 1) (variant 1) 1–5000 characters.
body.content[].content[].typeconstantYes(variant 1) (variant 1) Always "text".
body.content[].content[].typeconstantYes(variant 1) (variant 2) Always "hardBreak".
body.content[].content[].attrsobjectYes(variant 1) (variant 3)
body.content[].content[].marksarray<object | object | object | object>No(variant 1) (variant 3) Up to 4 items.
body.content[].content[].typeconstantYes(variant 1) (variant 3) Always "placeholder".
body.content[].typeconstantYes(variant 1) Always "paragraph".
body.content[].attrsobjectYes(variant 2)
body.content[].attrs.alignmentenumNo(variant 2) One of: "left", "center", "right".
body.content[].attrs.levelintegerYes(variant 2)
body.content[].contentarray<object | object | object>No(variant 2) Up to 200 items.
body.content[].content[].marksarray<object | object | object | object>No(variant 2) (variant 1) Up to 4 items.
body.content[].content[].textstringYes(variant 2) (variant 1) 1–5000 characters.
body.content[].content[].typeconstantYes(variant 2) (variant 1) Always "text".
body.content[].content[].typeconstantYes(variant 2) (variant 2) Always "hardBreak".
body.content[].content[].attrsobjectYes(variant 2) (variant 3)
body.content[].content[].marksarray<object | object | object | object>No(variant 2) (variant 3) Up to 4 items.
body.content[].content[].typeconstantYes(variant 2) (variant 3) Always "placeholder".
body.content[].typeconstantYes(variant 2) Always "heading".
body.content[].contentarray<EmailListItemInput>Yes(variant 3) Up to 50 items.
body.content[].content[].contentarray<object | object | object | object | object | object | object | object>Yes(variant 3) Up to 20 items.
body.content[].content[].typeconstantYes(variant 3) Always "listItem".
body.content[].typeenumYes(variant 3) One of: "bulletList", "orderedList".
body.content[].attrsobjectYes(variant 4)
body.content[].attrs.alignmentenumNo(variant 4) One of: "left", "center", "right".
body.content[].attrs.hrefstringYes(variant 4) Up to 2048 characters.
body.content[].attrs.stylestring | nullNo(variant 4) Up to 300 characters.
body.content[].contentarray<object | object | object>No(variant 4) Up to 200 items.
body.content[].content[].marksarray<object | object | object | object>No(variant 4) (variant 1) Up to 4 items.
body.content[].content[].textstringYes(variant 4) (variant 1) 1–5000 characters.
body.content[].content[].typeconstantYes(variant 4) (variant 1) Always "text".
body.content[].content[].typeconstantYes(variant 4) (variant 2) Always "hardBreak".
body.content[].content[].attrsobjectYes(variant 4) (variant 3)
body.content[].content[].marksarray<object | object | object | object>No(variant 4) (variant 3) Up to 4 items.
body.content[].content[].typeconstantYes(variant 4) (variant 3) Always "placeholder".
body.content[].typeconstantYes(variant 4) Always "button".
body.content[].typeconstantYes(variant 5) Always "horizontalRule".
body.content[].attrsobjectYes(variant 6)
body.content[].attrs.alignmentenumNo(variant 6) One of: "left", "center", "right".
body.content[].attrs.altstringNo(variant 6) Up to 300 characters. Default: "".
body.content[].attrs.hrefstring | nullNo(variant 6) Up to 2048 characters.
body.content[].attrs.srcstring (uri)Yes(variant 6) Up to 2048 characters.
body.content[].attrs.widthintegerNo(variant 6) Between 16 and 600.
body.content[].typeconstantYes(variant 6) Always "image".
body.content[].contentarrayYes(variant 7) Up to 2 items.
body.content[].typeconstantYes(variant 7) Always "twoColumns".
body.content[].attrsobjectYes(variant 8)
body.content[].attrs.keystringYes(variant 8) Pattern: ^[a-z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)*$.
body.content[].typeconstantYes(variant 8) Always "placeholderBlock".
body.typeenumYesOne of: "doc".
preheaderstringNoUp to 200 characters.
subjectstringYes1–200 characters.

Response 200

FieldTypeRequiredDescription
contentany | nullYes—
idstringYes—
publishedAtstring (date-time) | nullYes—
updatedAtstring (date-time)Yes—
versioninteger | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X PUT "$ANSWERSTACK_API_URL/v1/account/emails/{key}/draft" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "subject": "string",
  "body": {
    "type": "doc",
    "content": [
      {
        "type": "paragraph"
      }
    ]
  }
}'

Discard the draft of a staff alert#

DELETE /v1/account/emails/{key}/draft

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
keystringYesUp to 80 characters.

Response 204

No content.

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X DELETE "$ANSWERSTACK_API_URL/v1/account/emails/{key}/draft" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Keep this version after our default changed ("Keep mine")#

POST /v1/account/emails/{key}/keep

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
keystringYesUp to 80 characters.

Response 200

FieldTypeRequiredDescription
contentany | nullYes—
idstringYes—
publishedAtstring (date-time) | nullYes—
updatedAtstring (date-time)Yes—
versioninteger | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/emails/{key}/keep" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Render a staff alert or caller email with sample values, in the brand that applies#

POST /v1/account/emails/{key}/preview

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
keystringYesUp to 80 characters.

Request body

application/json, required.

FieldTypeRequiredDescription
complianceModebooleanNo—
groupIdstring (grp_… ID)NoID (grp_…)
templateobjectNo—
template.bodyobjectYes—
template.body.contentarray<object | object | object | object | object | object | object | object>YesUp to 200 items.
template.body.content[].attrsobjectNo(variant 1)
template.body.content[].contentarray<object | object | object>No(variant 1) Up to 200 items.
template.body.content[].typeconstantYes(variant 1) Always "paragraph".
template.body.content[].attrsobjectYes(variant 2)
template.body.content[].contentarray<object | object | object>No(variant 2) Up to 200 items.
template.body.content[].typeconstantYes(variant 2) Always "heading".
template.body.content[].contentarray<EmailListItemInput>Yes(variant 3) Up to 50 items.
template.body.content[].typeenumYes(variant 3) One of: "bulletList", "orderedList".
template.body.content[].attrsobjectYes(variant 4)
template.body.content[].contentarray<object | object | object>No(variant 4) Up to 200 items.
template.body.content[].typeconstantYes(variant 4) Always "button".
template.body.content[].typeconstantYes(variant 5) Always "horizontalRule".
template.body.content[].attrsobjectYes(variant 6)
template.body.content[].typeconstantYes(variant 6) Always "image".
template.body.content[].contentarrayYes(variant 7) Up to 2 items.
template.body.content[].typeconstantYes(variant 7) Always "twoColumns".
template.body.content[].attrsobjectYes(variant 8)
template.body.content[].typeconstantYes(variant 8) Always "placeholderBlock".
template.body.typeenumYesOne of: "doc".
template.preheaderstringNoUp to 200 characters.
template.subjectstringYes1–200 characters.

Response 200

FieldTypeRequiredDescription
htmlstringYes—
issuesarray<object>Yes—
issues[].messagestringYes—
issues[].patharray<string | number>Yes—
preheaderstringYes—
subjectstringYes—
textstringYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/emails/{key}/preview" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "complianceMode": true,
  "groupId": "grp_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE",
  "template": {
    "subject": "string",
    "body": {
      "type": "doc",
      "content": [
        {
          "type": "paragraph"
        }
      ]
    }
  }
}'

Publish the draft of a staff alert; it applies to the next send#

POST /v1/account/emails/{key}/publish

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
keystringYesUp to 80 characters.

Response 200

FieldTypeRequiredDescription
contentany | nullYes—
idstringYes—
publishedAtstring (date-time) | nullYes—
updatedAtstring (date-time)Yes—
versioninteger | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/emails/{key}/publish" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Go back to the layer below (the account’s version, or our default)#

POST /v1/account/emails/{key}/reset

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
keystringYesUp to 80 characters.

Response 200

FieldTypeRequiredDescription
contentany | nullYes—
idstringYes—
publishedAtstring (date-time) | nullYes—
updatedAtstring (date-time)Yes—
versioninteger | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/emails/{key}/reset" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Send a test of an email, with sample values, to the addresses given or your own address#

POST /v1/account/emails/{key}/test

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
keystringYesUp to 80 characters.

Request body

application/json, required.

FieldTypeRequiredDescription
complianceModebooleanNo—
groupIdstring (grp_… ID)NoID (grp_…)
templateobjectNo—
template.bodyobjectYes—
template.body.contentarray<object | object | object | object | object | object | object | object>YesUp to 200 items.
template.body.content[].attrsobjectNo(variant 1)
template.body.content[].contentarray<object | object | object>No(variant 1) Up to 200 items.
template.body.content[].typeconstantYes(variant 1) Always "paragraph".
template.body.content[].attrsobjectYes(variant 2)
template.body.content[].contentarray<object | object | object>No(variant 2) Up to 200 items.
template.body.content[].typeconstantYes(variant 2) Always "heading".
template.body.content[].contentarray<EmailListItemInput>Yes(variant 3) Up to 50 items.
template.body.content[].typeenumYes(variant 3) One of: "bulletList", "orderedList".
template.body.content[].attrsobjectYes(variant 4)
template.body.content[].contentarray<object | object | object>No(variant 4) Up to 200 items.
template.body.content[].typeconstantYes(variant 4) Always "button".
template.body.content[].typeconstantYes(variant 5) Always "horizontalRule".
template.body.content[].attrsobjectYes(variant 6)
template.body.content[].typeconstantYes(variant 6) Always "image".
template.body.content[].contentarrayYes(variant 7) Up to 2 items.
template.body.content[].typeconstantYes(variant 7) Always "twoColumns".
template.body.content[].attrsobjectYes(variant 8)
template.body.content[].typeconstantYes(variant 8) Always "placeholderBlock".
template.body.typeenumYesOne of: "doc".
template.preheaderstringNoUp to 200 characters.
template.subjectstringYes1–200 characters.
toarray<string (email)>NoUp to 5 items.

Response 200

FieldTypeRequiredDescription
reasonstringNo—
sentbooleanYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/emails/{key}/test" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "complianceMode": true,
  "groupId": "grp_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE",
  "template": {
    "subject": "string",
    "body": {
      "type": "doc",
      "content": [
        {
          "type": "paragraph"
        }
      ]
    }
  },
  "to": [
    "[email protected]"
  ]
}'

One group's staff alerts: which it has its own version of#

GET /v1/account/groups/{groupId}/emails

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
groupIdstring (grp_… ID)YesID (grp_…)

Response 200

FieldTypeRequiredDescription
emailsarray<AccountEmailListItem>Yes—
emails[].customizedbooleanYes—
emails[].defaultUpdatedbooleanYes—
emails[].groupsCustomizedintegerYes—
emails[].hasDraftbooleanYes—
emails[].keyEmailKeyYes—
emails[].key.audienceenumYesOne of: "caller", "staff", "user", "internal".
emails[].key.defaultsEmailTemplateContentYes—
emails[].key.defaults.bodyanyYes—
emails[].key.defaults.preheaderstringNo—
emails[].key.defaults.subjectstringYes—
emails[].key.descriptionstringYes—
emails[].key.keystringYes—
emails[].key.labelstringYes—
emails[].key.linkOnlybooleanYes—
emails[].key.ownerenumYesOne of: "account", "platform".
emails[].key.placeholdersarray<EmailPlaceholder>Yes—
emails[].key.placeholders[].blockbooleanYes—
emails[].key.placeholders[].keystringYes—
emails[].key.placeholders[].labelstringYes—
emails[].key.placeholders[].personalbooleanYes—
emails[].key.placeholders[].urlbooleanYes—
emails[].key.requiredarray<string>Yes—
emails[].publishedVersioninteger | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X GET "$ANSWERSTACK_API_URL/v1/account/groups/{groupId}/emails" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

One staff alert: the version in force, the draft, the history and the default#

GET /v1/account/groups/{groupId}/emails/{key}

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
groupIdstring (grp_… ID)YesID (grp_…)
keystringYesUp to 80 characters.

Response 200

FieldTypeRequiredDescription
defaultUpdatedany | nullYes—
draftany | nullYes—
historyarray<EmailVersion>Yes—
history[].contentany | nullYes—
history[].idstringYes—
history[].publishedAtstring (date-time) | nullYes—
history[].updatedAtstring (date-time)Yes—
history[].versioninteger | nullYes—
inheritedEmailTemplateContentYes—
inherited.bodyanyYes—
inherited.preheaderstringNo—
inherited.subjectstringYes—
inheritsFromenumYesOne of: "account", "default".
keyEmailKeyYes—
key.audienceenumYesOne of: "caller", "staff", "user", "internal".
key.defaultsEmailTemplateContentYes—
key.defaults.bodyanyYes—
key.defaults.preheaderstringNo—
key.defaults.subjectstringYes—
key.descriptionstringYes—
key.keystringYes—
key.labelstringYes—
key.linkOnlybooleanYes—
key.ownerenumYesOne of: "account", "platform".
key.placeholdersarray<EmailPlaceholder>Yes—
key.placeholders[].blockbooleanYes—
key.placeholders[].keystringYes—
key.placeholders[].labelstringYes—
key.placeholders[].personalbooleanYes—
key.placeholders[].urlbooleanYes—
key.requiredarray<string>Yes—
publishedany | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X GET "$ANSWERSTACK_API_URL/v1/account/groups/{groupId}/emails/{key}" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Save the draft of a staff alert (checked: placeholders, required parts, images)#

PUT /v1/account/groups/{groupId}/emails/{key}/draft

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
groupIdstring (grp_… ID)YesID (grp_…)
keystringYesUp to 80 characters.

Request body

application/json, required.

FieldTypeRequiredDescription
bodyobjectYes—
body.contentarray<object | object | object | object | object | object | object | object>YesUp to 200 items.
body.content[].attrsobjectNo(variant 1)
body.content[].attrs.alignmentenumNo(variant 1) One of: "left", "center", "right".
body.content[].contentarray<object | object | object>No(variant 1) Up to 200 items.
body.content[].content[].marksarray<object | object | object | object>No(variant 1) (variant 1) Up to 4 items.
body.content[].content[].textstringYes(variant 1) (variant 1) 1–5000 characters.
body.content[].content[].typeconstantYes(variant 1) (variant 1) Always "text".
body.content[].content[].typeconstantYes(variant 1) (variant 2) Always "hardBreak".
body.content[].content[].attrsobjectYes(variant 1) (variant 3)
body.content[].content[].marksarray<object | object | object | object>No(variant 1) (variant 3) Up to 4 items.
body.content[].content[].typeconstantYes(variant 1) (variant 3) Always "placeholder".
body.content[].typeconstantYes(variant 1) Always "paragraph".
body.content[].attrsobjectYes(variant 2)
body.content[].attrs.alignmentenumNo(variant 2) One of: "left", "center", "right".
body.content[].attrs.levelintegerYes(variant 2)
body.content[].contentarray<object | object | object>No(variant 2) Up to 200 items.
body.content[].content[].marksarray<object | object | object | object>No(variant 2) (variant 1) Up to 4 items.
body.content[].content[].textstringYes(variant 2) (variant 1) 1–5000 characters.
body.content[].content[].typeconstantYes(variant 2) (variant 1) Always "text".
body.content[].content[].typeconstantYes(variant 2) (variant 2) Always "hardBreak".
body.content[].content[].attrsobjectYes(variant 2) (variant 3)
body.content[].content[].marksarray<object | object | object | object>No(variant 2) (variant 3) Up to 4 items.
body.content[].content[].typeconstantYes(variant 2) (variant 3) Always "placeholder".
body.content[].typeconstantYes(variant 2) Always "heading".
body.content[].contentarray<EmailListItemInput>Yes(variant 3) Up to 50 items.
body.content[].content[].contentarray<object | object | object | object | object | object | object | object>Yes(variant 3) Up to 20 items.
body.content[].content[].typeconstantYes(variant 3) Always "listItem".
body.content[].typeenumYes(variant 3) One of: "bulletList", "orderedList".
body.content[].attrsobjectYes(variant 4)
body.content[].attrs.alignmentenumNo(variant 4) One of: "left", "center", "right".
body.content[].attrs.hrefstringYes(variant 4) Up to 2048 characters.
body.content[].attrs.stylestring | nullNo(variant 4) Up to 300 characters.
body.content[].contentarray<object | object | object>No(variant 4) Up to 200 items.
body.content[].content[].marksarray<object | object | object | object>No(variant 4) (variant 1) Up to 4 items.
body.content[].content[].textstringYes(variant 4) (variant 1) 1–5000 characters.
body.content[].content[].typeconstantYes(variant 4) (variant 1) Always "text".
body.content[].content[].typeconstantYes(variant 4) (variant 2) Always "hardBreak".
body.content[].content[].attrsobjectYes(variant 4) (variant 3)
body.content[].content[].marksarray<object | object | object | object>No(variant 4) (variant 3) Up to 4 items.
body.content[].content[].typeconstantYes(variant 4) (variant 3) Always "placeholder".
body.content[].typeconstantYes(variant 4) Always "button".
body.content[].typeconstantYes(variant 5) Always "horizontalRule".
body.content[].attrsobjectYes(variant 6)
body.content[].attrs.alignmentenumNo(variant 6) One of: "left", "center", "right".
body.content[].attrs.altstringNo(variant 6) Up to 300 characters. Default: "".
body.content[].attrs.hrefstring | nullNo(variant 6) Up to 2048 characters.
body.content[].attrs.srcstring (uri)Yes(variant 6) Up to 2048 characters.
body.content[].attrs.widthintegerNo(variant 6) Between 16 and 600.
body.content[].typeconstantYes(variant 6) Always "image".
body.content[].contentarrayYes(variant 7) Up to 2 items.
body.content[].typeconstantYes(variant 7) Always "twoColumns".
body.content[].attrsobjectYes(variant 8)
body.content[].attrs.keystringYes(variant 8) Pattern: ^[a-z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)*$.
body.content[].typeconstantYes(variant 8) Always "placeholderBlock".
body.typeenumYesOne of: "doc".
preheaderstringNoUp to 200 characters.
subjectstringYes1–200 characters.

Response 200

FieldTypeRequiredDescription
contentany | nullYes—
idstringYes—
publishedAtstring (date-time) | nullYes—
updatedAtstring (date-time)Yes—
versioninteger | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X PUT "$ANSWERSTACK_API_URL/v1/account/groups/{groupId}/emails/{key}/draft" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "subject": "string",
  "body": {
    "type": "doc",
    "content": [
      {
        "type": "paragraph"
      }
    ]
  }
}'

Discard the draft of a staff alert#

DELETE /v1/account/groups/{groupId}/emails/{key}/draft

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
groupIdstring (grp_… ID)YesID (grp_…)
keystringYesUp to 80 characters.

Response 204

No content.

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X DELETE "$ANSWERSTACK_API_URL/v1/account/groups/{groupId}/emails/{key}/draft" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Keep this version after our default changed ("Keep mine")#

POST /v1/account/groups/{groupId}/emails/{key}/keep

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
groupIdstring (grp_… ID)YesID (grp_…)
keystringYesUp to 80 characters.

Response 200

FieldTypeRequiredDescription
contentany | nullYes—
idstringYes—
publishedAtstring (date-time) | nullYes—
updatedAtstring (date-time)Yes—
versioninteger | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/groups/{groupId}/emails/{key}/keep" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Publish the draft of a staff alert; it applies to the next send#

POST /v1/account/groups/{groupId}/emails/{key}/publish

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
groupIdstring (grp_… ID)YesID (grp_…)
keystringYesUp to 80 characters.

Response 200

FieldTypeRequiredDescription
contentany | nullYes—
idstringYes—
publishedAtstring (date-time) | nullYes—
updatedAtstring (date-time)Yes—
versioninteger | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/groups/{groupId}/emails/{key}/publish" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Go back to the layer below (the account’s version, or our default)#

POST /v1/account/groups/{groupId}/emails/{key}/reset

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
groupIdstring (grp_… ID)YesID (grp_…)
keystringYesUp to 80 characters.

Response 200

FieldTypeRequiredDescription
contentany | nullYes—
idstringYes—
publishedAtstring (date-time) | nullYes—
updatedAtstring (date-time)Yes—
versioninteger | nullYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/groups/{groupId}/emails/{key}/reset" \
  -H "Authorization: Bearer $ACCESS_TOKEN"