template-list

Returns the list of all or some templates of the account.

You can iterate thru large list using “offset” and “limit” parameters. When less than “limit” templates are returned then the end of list is reached.

https://dns-name/template/list

Request Body

POST https://dns-name/template/list
Content-Type: application/json
X-API-KEY: Value

{
  "limit": 0,
  "offset": 0
}

Request Parameters

NameTypeDescription
limitINTEGERLimits the number of templates returned, default is 50
offsetINTEGERIndex of the first template in the list, starting with 0

Response Body

{
  "status": "string",
  "templates": [
    {
      "id": "string",
      "name": "string",
      "body": {
        "html": "string",
        "plaintext": "string",
        "amp": "string"
      },
      "subject": "string",
      "headers": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "attachments": [
        {
          "type": "string",
          "name": "string",
          "content": "string"
        }
      ],
      "template_builder": "string",
      "template_creator": "string",
      "global_replacements": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "global_info": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "sender_email": "string",
      "sender_name": "string",
      "reply_to": "string",
      "check_links": 0,
      "check_read": 0,
      "inline_attachments": [
        {
          "type": "string",
          "name": "string",
          "content": "string"
        }
      ]
    }
  ]
}

Response Parameters

NameTypeDescription
statusSTRING
REQUIRED
«Success» string
templatesARRAY
REQUIRED
Array of template objects
»idSTRING (UUID)
REQUIRED
Template unique identifier
»nameSTRING (UUID)
REQUIRED
Template name
»template_builderSTRINGEditor type, “html” or “visual”. Default is “html”. You can create a template with “visual” editor type only in web interface.
»global_replacementsOBJECTObject for passing the substitutions(merge tags) common for all recipients – e.g., company name. If the substitution names are duplicated in object “substitutions”, the values of the variables will be taken from the object “substitutions”. The substitutions can be used in the following parameters:

– body.html
– body.plaintext
– body.amp
– subject
– sender_name
– headers[“List-Unsubscribe”]
– options.unsubscribe_url


A substitution name can consist from latin characters, numbers and “_” or “-” symbols, and should start with the letter.
»global_infoOBJECTObject for passing the info common for all the recipients, such as “key”: “value”. Max key quantity: 10. Max key length: 64 symbols. Max value length: 1024 symbols. The metadata is returned by webhook on your endpoint.
»bodyOBJECT REQUIREDContains HTML/plaintext/AMP parts of the email. Either html or plaintext part is required.
»»htmlSTRINGHTML part of the email body
»»plaintextSTRINGPlaintext part of the email body
»»ampSTRINGOptional AMP part of the email body
»subjectSTRINGEmail subject
»sender_emailSTRINGSender’s email. Required only if template_id parameter is empty.
»sender_nameSTRINGSender’s name
»reply_toSTRINGOptional Reply-To email (in case it’s different to sender’s email)
»check_linksINTEGER1=click tracking is on (default), 0=click tracking is off
»check_readINTEGER1=read tracking is on (default), 0=read tracking is off
»headersOBJECTContains email headers, maximum 50. Only headers with “X-” name prefix are accepted, all other are ignored, for example X-GMS-Global-Language, X-GMS-Template-Engine.
»attachmentsARRAY Optional array of attachments
»»typeSTRING REQUIREDAttachment type, see MIME. If unsure, use “application/octet-stream”.
»»nameSTRING REQUIREDAttachment name in the format: “name.extension”
Attachment content id. For example, “name”=“IMAGECID1” should be referenced in HTML like <img src=“cid:IMAGECID1”>
»»contentSTRING (BYTE)
REQUIRED
File contents in base64. Maximum file size 7MB (9786710 bytes in base64).
»inline_attachmentsARRAY Optional array of inline attachments, e.g. for including images in email instead of loading them from external URL
»createdSTRING (UTC-DATA-TIME)
REQUIRED
Template creation date and time in UTC timezone in format “YYYY-MM-DD hh:mm:ss”
»user_idINTEGER
REQUIRED
Unique user identifier

HTTP Code default:

Error occurred
{
  "status": "string",
  "code": 0,
  "message": "string"
}
NameTypeDescription
statusSTRING
REQUIRED
«Error» string
messageSTRING
REQUIRED
Human-readable error message in English
codeINTEGER
REQUIRED
API Error code