Appearance
staff.mailTemplates
5 methods on staff.mailTemplates. Each returns the answer's data and throws NoviqaError on a failed answer.
list
GET
/admin/v1/mail-templatesList mail templates
Every template: notification templates (kinds deal, order, balance, code, statement — the texts platform e-mails and notices are written from, per templates folder and language) first, then the compose templates (kind message), each part by name. Not scope-limited.
More details
Rights: the staff member needs at least one of: config.mail, mailbox.
Returns
Promise<MailTemplate[]>The answer's
data.Errors
401
auth.session_expired: session expired, sign in again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.mailTemplates.list()bash
curl -X GET "$NOVIQA_API_URL/admin/v1/mail-templates" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": [
{
"body": "string",
"created_at": "2026-09-25T10:15:00Z",
"folder": "string",
"id": 1,
"kind": "string",
"language": "string",
"name": "Ann Smith",
"subject": "string",
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
}
],
"request_id": "5b7f2c1e"
}ts
staff.mailTemplates.list(options?: RequestOptions): Promise<models.MailTemplate[]>create
POST
/admin/v1/mail-templatesAdd a mail template
Adds a compose template (kind message, the default), or a deal/order/balance/statement notification text for a company's templates folder or in another language than the default. The standard notification templates exist from the start and are only edited. name 1-64 characters, folder up to 64 without leading or trailing spaces, language one of en, de (default en), subject up to 256 characters on one line, body up to 64 KiB; {{placeholders}} are filled per recipient. id, version and the times are set by the server. The name must be unused and a folder holds one template per kind and language. Writes a journal line.
More details
Rights: the staff member needs every one of: config.mail.
Request body
bodystringcreated_atstringUTC time, RFC 3339.
folderstringa company's templates folder; empty = the standard templates
idintegerkindstringlanguagestringthe language it is written in; notifications pick the account's
namestringsubjectstringupdated_atstringUTC time, RFC 3339.
versionintegerReturns
Promise<MailTemplate>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action409
conflict: already exists500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.mailTemplates.create({
body: "Your account {{login}} in {{currency}} is ready.",
kind: "message",
name: "Welcome",
subject: "Welcome, {{name}}"
})bash
curl -X POST "$NOVIQA_API_URL/admin/v1/mail-templates" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"body": "Your account {{login}} in {{currency}} is ready.",
"kind": "message",
"name": "Welcome",
"subject": "Welcome, {{name}}"
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"body": "string",
"created_at": "2026-09-25T10:15:00Z",
"folder": "string",
"id": 1,
"kind": "string",
"language": "string",
"name": "Ann Smith",
"subject": "string",
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
},
"request_id": "5b7f2c1e"
}ts
staff.mailTemplates.create(body: models.MailTemplate, options?: RequestOptions): Promise<models.MailTemplate>retrieve
GET
/admin/v1/mail-templates/{id}Read a mail template
One template.
More details
Rights: the staff member needs at least one of: config.mail, mailbox.
Parameters
idinteger · pathrequiredNumeric id.
Returns
Promise<MailTemplate>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action404
not_found: not found500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.mailTemplates.retrieve(1)bash
curl -X GET "$NOVIQA_API_URL/admin/v1/mail-templates/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"body": "string",
"created_at": "2026-09-25T10:15:00Z",
"folder": "string",
"id": 1,
"kind": "string",
"language": "string",
"name": "Ann Smith",
"subject": "string",
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
},
"request_id": "5b7f2c1e"
}ts
staff.mailTemplates.retrieve(id: number, options?: RequestOptions): Promise<models.MailTemplate>update
PATCH
/admin/v1/mail-templates/{id}Change a mail template
Changes name, subject or body only (any other field is refused; kind, folder and language are fixed). Same limits as creating. version is required and must be the one last read, else conflict; a body that changes nothing answers the template unchanged. Writes a journal line with the changed fields.
More details
Rights: the staff member needs every one of: config.mail.
Parameters
idinteger · pathrequiredNumeric id.
Request body
bodystringcreated_atstringUTC time, RFC 3339.
folderstringa company's templates folder; empty = the standard templates
idintegerkindstringlanguagestringthe language it is written in; notifications pick the account's
namestringsubjectstringupdated_atstringUTC time, RFC 3339.
versionintegerReturns
Promise<MailTemplate>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action404
not_found: not found409
conflict: already exists500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.mailTemplates.update(1, {
subject: "Welcome aboard, {{name}}",
version: 3
})bash
curl -X PATCH "$NOVIQA_API_URL/admin/v1/mail-templates/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"subject": "Welcome aboard, {{name}}",
"version": 3
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"body": "string",
"created_at": "2026-09-25T10:15:00Z",
"folder": "string",
"id": 1,
"kind": "string",
"language": "string",
"name": "Ann Smith",
"subject": "string",
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
},
"request_id": "5b7f2c1e"
}ts
staff.mailTemplates.update(id: number, body: models.MailTemplate, options?: RequestOptions): Promise<models.MailTemplate>delete
DELETE
/admin/v1/mail-templates/{id}Delete a mail template
Removes a compose template or a folder/language notification text. A standard notification template (no folder, default language) cannot be deleted. Writes a journal line.
More details
Rights: the staff member needs every one of: config.mail.
Parameters
idinteger · pathrequiredNumeric id.
Returns
Promise<null>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action404
not_found: not found500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.mailTemplates.delete(1)bash
curl -X DELETE "$NOVIQA_API_URL/admin/v1/mail-templates/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": null,
"request_id": "5b7f2c1e"
}ts
staff.mailTemplates.delete(id: number, options?: RequestOptions): Promise<null>