API reference
Emails
Emails endpoints.
| Method | Path | Summary |
|---|---|---|
POST | /v1/account/email-assets | Upload an image for an email (PNG, JPEG or GIF, at most 1 MB) |
GET | /v1/account/emails | The account's staff alerts: which it has changed, and any drafts |
GET | /v1/account/emails/caller | The caller emails a playbook can change, each with our default in force |
GET | /v1/account/emails/standard | The standard emails your people receive from us (read-only) |
GET | /v1/account/emails/standard/{key}/preview | One 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}/draft | Save the draft of a staff alert (checked: placeholders, required parts, images) |
DELETE | /v1/account/emails/{key}/draft | Discard the draft of a staff alert |
POST | /v1/account/emails/{key}/keep | Keep this version after our default changed ("Keep mine") |
POST | /v1/account/emails/{key}/preview | Render a staff alert or caller email with sample values, in the brand that applies |
POST | /v1/account/emails/{key}/publish | Publish the draft of a staff alert; it applies to the next send |
POST | /v1/account/emails/{key}/reset | Go back to the layer below (the account’s version, or our default) |
POST | /v1/account/emails/{key}/test | Send a test of an email, with sample values, to the addresses given or your own address |
GET | /v1/account/groups/{groupId}/emails | One 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}/draft | Save the draft of a staff alert (checked: placeholders, required parts, images) |
DELETE | /v1/account/groups/{groupId}/emails/{key}/draft | Discard the draft of a staff alert |
POST | /v1/account/groups/{groupId}/emails/{key}/keep | Keep this version after our default changed ("Keep mine") |
POST | /v1/account/groups/{groupId}/emails/{key}/publish | Publish the draft of a staff alert; it applies to the next send |
POST | /v1/account/groups/{groupId}/emails/{key}/reset | Go 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
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Field | Type | Required | Description |
|---|---|---|---|
emails | array<AccountEmailListItem> | Yes | — |
emails[].customized | boolean | Yes | — |
emails[].defaultUpdated | boolean | Yes | — |
emails[].groupsCustomized | integer | Yes | — |
emails[].hasDraft | boolean | Yes | — |
emails[].key | EmailKey | Yes | — |
emails[].key.audience | enum | Yes | One of: "caller", "staff", "user", "internal". |
emails[].key.defaults | EmailTemplateContent | Yes | — |
emails[].key.defaults.body | any | Yes | — |
emails[].key.defaults.preheader | string | No | — |
emails[].key.defaults.subject | string | Yes | — |
emails[].key.description | string | Yes | — |
emails[].key.key | string | Yes | — |
emails[].key.label | string | Yes | — |
emails[].key.linkOnly | boolean | Yes | — |
emails[].key.owner | enum | Yes | One of: "account", "platform". |
emails[].key.placeholders | array<EmailPlaceholder> | Yes | — |
emails[].key.placeholders[].block | boolean | Yes | — |
emails[].key.placeholders[].key | string | Yes | — |
emails[].key.placeholders[].label | string | Yes | — |
emails[].key.placeholders[].personal | boolean | Yes | — |
emails[].key.placeholders[].url | boolean | Yes | — |
emails[].key.required | array<string> | Yes | — |
emails[].publishedVersion | integer | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Field | Type | Required | Description |
|---|---|---|---|
emails | array<object> | Yes | — |
emails[].default | EmailTemplateContent | Yes | — |
emails[].default.body | any | Yes | — |
emails[].default.preheader | string | No | — |
emails[].default.subject | string | Yes | — |
emails[].key | EmailKey | Yes | — |
emails[].key.audience | enum | Yes | One of: "caller", "staff", "user", "internal". |
emails[].key.defaults | EmailTemplateContent | Yes | — |
emails[].key.defaults.body | any | Yes | — |
emails[].key.defaults.preheader | string | No | — |
emails[].key.defaults.subject | string | Yes | — |
emails[].key.description | string | Yes | — |
emails[].key.key | string | Yes | — |
emails[].key.label | string | Yes | — |
emails[].key.linkOnly | boolean | Yes | — |
emails[].key.owner | enum | Yes | One of: "account", "platform". |
emails[].key.placeholders | array<EmailPlaceholder> | Yes | — |
emails[].key.placeholders[].block | boolean | Yes | — |
emails[].key.placeholders[].key | string | Yes | — |
emails[].key.placeholders[].label | string | Yes | — |
emails[].key.placeholders[].personal | boolean | Yes | — |
emails[].key.placeholders[].url | boolean | Yes | — |
emails[].key.required | array<string> | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Field | Type | Required | Description |
|---|---|---|---|
emails | array<EmailKey> | Yes | — |
emails[].audience | enum | Yes | One of: "caller", "staff", "user", "internal". |
emails[].defaults | EmailTemplateContent | Yes | — |
emails[].defaults.body | any | Yes | — |
emails[].defaults.preheader | string | No | — |
emails[].defaults.subject | string | Yes | — |
emails[].description | string | Yes | — |
emails[].key | string | Yes | — |
emails[].label | string | Yes | — |
emails[].linkOnly | boolean | Yes | — |
emails[].owner | enum | Yes | One of: "account", "platform". |
emails[].placeholders | array<EmailPlaceholder> | Yes | — |
emails[].placeholders[].block | boolean | Yes | — |
emails[].placeholders[].key | string | Yes | — |
emails[].placeholders[].label | string | Yes | — |
emails[].placeholders[].personal | boolean | Yes | — |
emails[].placeholders[].url | boolean | Yes | — |
emails[].required | array<string> | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Up to 80 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
html | string | Yes | — |
issues | array<object> | Yes | — |
issues[].message | string | Yes | — |
issues[].path | array<string | number> | Yes | — |
preheader | string | Yes | — |
subject | string | Yes | — |
text | string | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Up to 80 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
defaultUpdated | any | null | Yes | — |
draft | any | null | Yes | — |
history | array<EmailVersion> | Yes | — |
history[].content | any | null | Yes | — |
history[].id | string | Yes | — |
history[].publishedAt | string (date-time) | null | Yes | — |
history[].updatedAt | string (date-time) | Yes | — |
history[].version | integer | null | Yes | — |
inherited | EmailTemplateContent | Yes | — |
inherited.body | any | Yes | — |
inherited.preheader | string | No | — |
inherited.subject | string | Yes | — |
inheritsFrom | enum | Yes | One of: "account", "default". |
key | EmailKey | Yes | — |
key.audience | enum | Yes | One of: "caller", "staff", "user", "internal". |
key.defaults | EmailTemplateContent | Yes | — |
key.defaults.body | any | Yes | — |
key.defaults.preheader | string | No | — |
key.defaults.subject | string | Yes | — |
key.description | string | Yes | — |
key.key | string | Yes | — |
key.label | string | Yes | — |
key.linkOnly | boolean | Yes | — |
key.owner | enum | Yes | One of: "account", "platform". |
key.placeholders | array<EmailPlaceholder> | Yes | — |
key.placeholders[].block | boolean | Yes | — |
key.placeholders[].key | string | Yes | — |
key.placeholders[].label | string | Yes | — |
key.placeholders[].personal | boolean | Yes | — |
key.placeholders[].url | boolean | Yes | — |
key.required | array<string> | Yes | — |
published | any | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Up to 80 characters. |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
body | object | Yes | — |
body.content | array<object | object | object | object | object | object | object | object> | Yes | Up to 200 items. |
body.content[].attrs | object | No | (variant 1) |
body.content[].attrs.alignment | enum | No | (variant 1) One of: "left", "center", "right". |
body.content[].content | array<object | object | object> | No | (variant 1) Up to 200 items. |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 1) (variant 1) Up to 4 items. |
body.content[].content[].text | string | Yes | (variant 1) (variant 1) 1–5000 characters. |
body.content[].content[].type | constant | Yes | (variant 1) (variant 1) Always "text". |
body.content[].content[].type | constant | Yes | (variant 1) (variant 2) Always "hardBreak". |
body.content[].content[].attrs | object | Yes | (variant 1) (variant 3) |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 1) (variant 3) Up to 4 items. |
body.content[].content[].type | constant | Yes | (variant 1) (variant 3) Always "placeholder". |
body.content[].type | constant | Yes | (variant 1) Always "paragraph". |
body.content[].attrs | object | Yes | (variant 2) |
body.content[].attrs.alignment | enum | No | (variant 2) One of: "left", "center", "right". |
body.content[].attrs.level | integer | Yes | (variant 2) |
body.content[].content | array<object | object | object> | No | (variant 2) Up to 200 items. |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 2) (variant 1) Up to 4 items. |
body.content[].content[].text | string | Yes | (variant 2) (variant 1) 1–5000 characters. |
body.content[].content[].type | constant | Yes | (variant 2) (variant 1) Always "text". |
body.content[].content[].type | constant | Yes | (variant 2) (variant 2) Always "hardBreak". |
body.content[].content[].attrs | object | Yes | (variant 2) (variant 3) |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 2) (variant 3) Up to 4 items. |
body.content[].content[].type | constant | Yes | (variant 2) (variant 3) Always "placeholder". |
body.content[].type | constant | Yes | (variant 2) Always "heading". |
body.content[].content | array<EmailListItemInput> | Yes | (variant 3) Up to 50 items. |
body.content[].content[].content | array<object | object | object | object | object | object | object | object> | Yes | (variant 3) Up to 20 items. |
body.content[].content[].type | constant | Yes | (variant 3) Always "listItem". |
body.content[].type | enum | Yes | (variant 3) One of: "bulletList", "orderedList". |
body.content[].attrs | object | Yes | (variant 4) |
body.content[].attrs.alignment | enum | No | (variant 4) One of: "left", "center", "right". |
body.content[].attrs.href | string | Yes | (variant 4) Up to 2048 characters. |
body.content[].attrs.style | string | null | No | (variant 4) Up to 300 characters. |
body.content[].content | array<object | object | object> | No | (variant 4) Up to 200 items. |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 4) (variant 1) Up to 4 items. |
body.content[].content[].text | string | Yes | (variant 4) (variant 1) 1–5000 characters. |
body.content[].content[].type | constant | Yes | (variant 4) (variant 1) Always "text". |
body.content[].content[].type | constant | Yes | (variant 4) (variant 2) Always "hardBreak". |
body.content[].content[].attrs | object | Yes | (variant 4) (variant 3) |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 4) (variant 3) Up to 4 items. |
body.content[].content[].type | constant | Yes | (variant 4) (variant 3) Always "placeholder". |
body.content[].type | constant | Yes | (variant 4) Always "button". |
body.content[].type | constant | Yes | (variant 5) Always "horizontalRule". |
body.content[].attrs | object | Yes | (variant 6) |
body.content[].attrs.alignment | enum | No | (variant 6) One of: "left", "center", "right". |
body.content[].attrs.alt | string | No | (variant 6) Up to 300 characters. Default: "". |
body.content[].attrs.href | string | null | No | (variant 6) Up to 2048 characters. |
body.content[].attrs.src | string (uri) | Yes | (variant 6) Up to 2048 characters. |
body.content[].attrs.width | integer | No | (variant 6) Between 16 and 600. |
body.content[].type | constant | Yes | (variant 6) Always "image". |
body.content[].content | array | Yes | (variant 7) Up to 2 items. |
body.content[].type | constant | Yes | (variant 7) Always "twoColumns". |
body.content[].attrs | object | Yes | (variant 8) |
body.content[].attrs.key | string | Yes | (variant 8) Pattern: ^[a-z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)*$. |
body.content[].type | constant | Yes | (variant 8) Always "placeholderBlock". |
body.type | enum | Yes | One of: "doc". |
preheader | string | No | Up to 200 characters. |
subject | string | Yes | 1–200 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
content | any | null | Yes | — |
id | string | Yes | — |
publishedAt | string (date-time) | null | Yes | — |
updatedAt | string (date-time) | Yes | — |
version | integer | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Up to 80 characters. |
Response 204
No content.
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Up to 80 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
content | any | null | Yes | — |
id | string | Yes | — |
publishedAt | string (date-time) | null | Yes | — |
updatedAt | string (date-time) | Yes | — |
version | integer | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Up to 80 characters. |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
complianceMode | boolean | No | — |
groupId | string (grp_… ID) | No | ID (grp_…) |
template | object | No | — |
template.body | object | Yes | — |
template.body.content | array<object | object | object | object | object | object | object | object> | Yes | Up to 200 items. |
template.body.content[].attrs | object | No | (variant 1) |
template.body.content[].content | array<object | object | object> | No | (variant 1) Up to 200 items. |
template.body.content[].type | constant | Yes | (variant 1) Always "paragraph". |
template.body.content[].attrs | object | Yes | (variant 2) |
template.body.content[].content | array<object | object | object> | No | (variant 2) Up to 200 items. |
template.body.content[].type | constant | Yes | (variant 2) Always "heading". |
template.body.content[].content | array<EmailListItemInput> | Yes | (variant 3) Up to 50 items. |
template.body.content[].type | enum | Yes | (variant 3) One of: "bulletList", "orderedList". |
template.body.content[].attrs | object | Yes | (variant 4) |
template.body.content[].content | array<object | object | object> | No | (variant 4) Up to 200 items. |
template.body.content[].type | constant | Yes | (variant 4) Always "button". |
template.body.content[].type | constant | Yes | (variant 5) Always "horizontalRule". |
template.body.content[].attrs | object | Yes | (variant 6) |
template.body.content[].type | constant | Yes | (variant 6) Always "image". |
template.body.content[].content | array | Yes | (variant 7) Up to 2 items. |
template.body.content[].type | constant | Yes | (variant 7) Always "twoColumns". |
template.body.content[].attrs | object | Yes | (variant 8) |
template.body.content[].type | constant | Yes | (variant 8) Always "placeholderBlock". |
template.body.type | enum | Yes | One of: "doc". |
template.preheader | string | No | Up to 200 characters. |
template.subject | string | Yes | 1–200 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
html | string | Yes | — |
issues | array<object> | Yes | — |
issues[].message | string | Yes | — |
issues[].path | array<string | number> | Yes | — |
preheader | string | Yes | — |
subject | string | Yes | — |
text | string | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Up to 80 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
content | any | null | Yes | — |
id | string | Yes | — |
publishedAt | string (date-time) | null | Yes | — |
updatedAt | string (date-time) | Yes | — |
version | integer | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Up to 80 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
content | any | null | Yes | — |
id | string | Yes | — |
publishedAt | string (date-time) | null | Yes | — |
updatedAt | string (date-time) | Yes | — |
version | integer | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Up to 80 characters. |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
complianceMode | boolean | No | — |
groupId | string (grp_… ID) | No | ID (grp_…) |
template | object | No | — |
template.body | object | Yes | — |
template.body.content | array<object | object | object | object | object | object | object | object> | Yes | Up to 200 items. |
template.body.content[].attrs | object | No | (variant 1) |
template.body.content[].content | array<object | object | object> | No | (variant 1) Up to 200 items. |
template.body.content[].type | constant | Yes | (variant 1) Always "paragraph". |
template.body.content[].attrs | object | Yes | (variant 2) |
template.body.content[].content | array<object | object | object> | No | (variant 2) Up to 200 items. |
template.body.content[].type | constant | Yes | (variant 2) Always "heading". |
template.body.content[].content | array<EmailListItemInput> | Yes | (variant 3) Up to 50 items. |
template.body.content[].type | enum | Yes | (variant 3) One of: "bulletList", "orderedList". |
template.body.content[].attrs | object | Yes | (variant 4) |
template.body.content[].content | array<object | object | object> | No | (variant 4) Up to 200 items. |
template.body.content[].type | constant | Yes | (variant 4) Always "button". |
template.body.content[].type | constant | Yes | (variant 5) Always "horizontalRule". |
template.body.content[].attrs | object | Yes | (variant 6) |
template.body.content[].type | constant | Yes | (variant 6) Always "image". |
template.body.content[].content | array | Yes | (variant 7) Up to 2 items. |
template.body.content[].type | constant | Yes | (variant 7) Always "twoColumns". |
template.body.content[].attrs | object | Yes | (variant 8) |
template.body.content[].type | constant | Yes | (variant 8) Always "placeholderBlock". |
template.body.type | enum | Yes | One of: "doc". |
template.preheader | string | No | Up to 200 characters. |
template.subject | string | Yes | 1–200 characters. |
to | array<string (email)> | No | Up to 5 items. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
reason | string | No | — |
sent | boolean | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
groupId | string (grp_… ID) | Yes | ID (grp_…) |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
emails | array<AccountEmailListItem> | Yes | — |
emails[].customized | boolean | Yes | — |
emails[].defaultUpdated | boolean | Yes | — |
emails[].groupsCustomized | integer | Yes | — |
emails[].hasDraft | boolean | Yes | — |
emails[].key | EmailKey | Yes | — |
emails[].key.audience | enum | Yes | One of: "caller", "staff", "user", "internal". |
emails[].key.defaults | EmailTemplateContent | Yes | — |
emails[].key.defaults.body | any | Yes | — |
emails[].key.defaults.preheader | string | No | — |
emails[].key.defaults.subject | string | Yes | — |
emails[].key.description | string | Yes | — |
emails[].key.key | string | Yes | — |
emails[].key.label | string | Yes | — |
emails[].key.linkOnly | boolean | Yes | — |
emails[].key.owner | enum | Yes | One of: "account", "platform". |
emails[].key.placeholders | array<EmailPlaceholder> | Yes | — |
emails[].key.placeholders[].block | boolean | Yes | — |
emails[].key.placeholders[].key | string | Yes | — |
emails[].key.placeholders[].label | string | Yes | — |
emails[].key.placeholders[].personal | boolean | Yes | — |
emails[].key.placeholders[].url | boolean | Yes | — |
emails[].key.required | array<string> | Yes | — |
emails[].publishedVersion | integer | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
groupId | string (grp_… ID) | Yes | ID (grp_…) |
key | string | Yes | Up to 80 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
defaultUpdated | any | null | Yes | — |
draft | any | null | Yes | — |
history | array<EmailVersion> | Yes | — |
history[].content | any | null | Yes | — |
history[].id | string | Yes | — |
history[].publishedAt | string (date-time) | null | Yes | — |
history[].updatedAt | string (date-time) | Yes | — |
history[].version | integer | null | Yes | — |
inherited | EmailTemplateContent | Yes | — |
inherited.body | any | Yes | — |
inherited.preheader | string | No | — |
inherited.subject | string | Yes | — |
inheritsFrom | enum | Yes | One of: "account", "default". |
key | EmailKey | Yes | — |
key.audience | enum | Yes | One of: "caller", "staff", "user", "internal". |
key.defaults | EmailTemplateContent | Yes | — |
key.defaults.body | any | Yes | — |
key.defaults.preheader | string | No | — |
key.defaults.subject | string | Yes | — |
key.description | string | Yes | — |
key.key | string | Yes | — |
key.label | string | Yes | — |
key.linkOnly | boolean | Yes | — |
key.owner | enum | Yes | One of: "account", "platform". |
key.placeholders | array<EmailPlaceholder> | Yes | — |
key.placeholders[].block | boolean | Yes | — |
key.placeholders[].key | string | Yes | — |
key.placeholders[].label | string | Yes | — |
key.placeholders[].personal | boolean | Yes | — |
key.placeholders[].url | boolean | Yes | — |
key.required | array<string> | Yes | — |
published | any | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
groupId | string (grp_… ID) | Yes | ID (grp_…) |
key | string | Yes | Up to 80 characters. |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
body | object | Yes | — |
body.content | array<object | object | object | object | object | object | object | object> | Yes | Up to 200 items. |
body.content[].attrs | object | No | (variant 1) |
body.content[].attrs.alignment | enum | No | (variant 1) One of: "left", "center", "right". |
body.content[].content | array<object | object | object> | No | (variant 1) Up to 200 items. |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 1) (variant 1) Up to 4 items. |
body.content[].content[].text | string | Yes | (variant 1) (variant 1) 1–5000 characters. |
body.content[].content[].type | constant | Yes | (variant 1) (variant 1) Always "text". |
body.content[].content[].type | constant | Yes | (variant 1) (variant 2) Always "hardBreak". |
body.content[].content[].attrs | object | Yes | (variant 1) (variant 3) |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 1) (variant 3) Up to 4 items. |
body.content[].content[].type | constant | Yes | (variant 1) (variant 3) Always "placeholder". |
body.content[].type | constant | Yes | (variant 1) Always "paragraph". |
body.content[].attrs | object | Yes | (variant 2) |
body.content[].attrs.alignment | enum | No | (variant 2) One of: "left", "center", "right". |
body.content[].attrs.level | integer | Yes | (variant 2) |
body.content[].content | array<object | object | object> | No | (variant 2) Up to 200 items. |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 2) (variant 1) Up to 4 items. |
body.content[].content[].text | string | Yes | (variant 2) (variant 1) 1–5000 characters. |
body.content[].content[].type | constant | Yes | (variant 2) (variant 1) Always "text". |
body.content[].content[].type | constant | Yes | (variant 2) (variant 2) Always "hardBreak". |
body.content[].content[].attrs | object | Yes | (variant 2) (variant 3) |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 2) (variant 3) Up to 4 items. |
body.content[].content[].type | constant | Yes | (variant 2) (variant 3) Always "placeholder". |
body.content[].type | constant | Yes | (variant 2) Always "heading". |
body.content[].content | array<EmailListItemInput> | Yes | (variant 3) Up to 50 items. |
body.content[].content[].content | array<object | object | object | object | object | object | object | object> | Yes | (variant 3) Up to 20 items. |
body.content[].content[].type | constant | Yes | (variant 3) Always "listItem". |
body.content[].type | enum | Yes | (variant 3) One of: "bulletList", "orderedList". |
body.content[].attrs | object | Yes | (variant 4) |
body.content[].attrs.alignment | enum | No | (variant 4) One of: "left", "center", "right". |
body.content[].attrs.href | string | Yes | (variant 4) Up to 2048 characters. |
body.content[].attrs.style | string | null | No | (variant 4) Up to 300 characters. |
body.content[].content | array<object | object | object> | No | (variant 4) Up to 200 items. |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 4) (variant 1) Up to 4 items. |
body.content[].content[].text | string | Yes | (variant 4) (variant 1) 1–5000 characters. |
body.content[].content[].type | constant | Yes | (variant 4) (variant 1) Always "text". |
body.content[].content[].type | constant | Yes | (variant 4) (variant 2) Always "hardBreak". |
body.content[].content[].attrs | object | Yes | (variant 4) (variant 3) |
body.content[].content[].marks | array<object | object | object | object> | No | (variant 4) (variant 3) Up to 4 items. |
body.content[].content[].type | constant | Yes | (variant 4) (variant 3) Always "placeholder". |
body.content[].type | constant | Yes | (variant 4) Always "button". |
body.content[].type | constant | Yes | (variant 5) Always "horizontalRule". |
body.content[].attrs | object | Yes | (variant 6) |
body.content[].attrs.alignment | enum | No | (variant 6) One of: "left", "center", "right". |
body.content[].attrs.alt | string | No | (variant 6) Up to 300 characters. Default: "". |
body.content[].attrs.href | string | null | No | (variant 6) Up to 2048 characters. |
body.content[].attrs.src | string (uri) | Yes | (variant 6) Up to 2048 characters. |
body.content[].attrs.width | integer | No | (variant 6) Between 16 and 600. |
body.content[].type | constant | Yes | (variant 6) Always "image". |
body.content[].content | array | Yes | (variant 7) Up to 2 items. |
body.content[].type | constant | Yes | (variant 7) Always "twoColumns". |
body.content[].attrs | object | Yes | (variant 8) |
body.content[].attrs.key | string | Yes | (variant 8) Pattern: ^[a-z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)*$. |
body.content[].type | constant | Yes | (variant 8) Always "placeholderBlock". |
body.type | enum | Yes | One of: "doc". |
preheader | string | No | Up to 200 characters. |
subject | string | Yes | 1–200 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
content | any | null | Yes | — |
id | string | Yes | — |
publishedAt | string (date-time) | null | Yes | — |
updatedAt | string (date-time) | Yes | — |
version | integer | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
groupId | string (grp_… ID) | Yes | ID (grp_…) |
key | string | Yes | Up to 80 characters. |
Response 204
No content.
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
groupId | string (grp_… ID) | Yes | ID (grp_…) |
key | string | Yes | Up to 80 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
content | any | null | Yes | — |
id | string | Yes | — |
publishedAt | string (date-time) | null | Yes | — |
updatedAt | string (date-time) | Yes | — |
version | integer | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
groupId | string (grp_… ID) | Yes | ID (grp_…) |
key | string | Yes | Up to 80 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
content | any | null | Yes | — |
id | string | Yes | — |
publishedAt | string (date-time) | null | Yes | — |
updatedAt | string (date-time) | Yes | — |
version | integer | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
groupId | string (grp_… ID) | Yes | ID (grp_…) |
key | string | Yes | Up to 80 characters. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
content | any | null | Yes | — |
id | string | Yes | — |
publishedAt | string (date-time) | null | Yes | — |
updatedAt | string (date-time) | Yes | — |
version | integer | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X POST "$ANSWERSTACK_API_URL/v1/account/groups/{groupId}/emails/{key}/reset" \
-H "Authorization: Bearer $ACCESS_TOKEN"