Skip to content

Get a template

GET
/mail/templates/{emailTemplate}
curl --request GET \
--url https://mail.work.optidata.cloud/api/mail/templates/22 \
--header 'Authorization: Bearer <token>'

One template, content included. Only the owner may read it.

emailTemplate
required
integer

Id of the template.

The template.

Media typeapplication/json

A reusable message body.

object
id
integer
user_id
integer
title
string | null
content

HTML content.

string
created_at
string
updated_at
string
Examplegenerated
{
"id": 1,
"user_id": 1,
"title": "example",
"content": "example",
"created_at": "example",
"updated_at": "example"
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller may not act on this mailbox, user or resource.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

No such resource, or it does not belong to the caller.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "No query results for model."
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}