Templates
Create, edit, validate, list and push email templates and layouts.
List templates
Lists the templates on the server with brief details. Filter by type with templateType or by wrapping layout with layoutTemplate.
query Parameters
countNumber of records to return per request. Max 500.
offsetNumber of records to skip.
templateTypeFilter by template type. Defaults to all types.
Standard templates render a full message; Layout templates wrap the content of Standard templates.
layoutTemplateFilter to templates that use the given Layout template alias.
List templates › Responses
A page of templates.
TotalCountNumber of templates matching the request.
Templates for the requested page.
Create a template
Creates a Standard or Layout template on the server. Standard templates need a Subject and at least one of HtmlBody or TextBody.
Create a template › Request Body
NameTemplate name.
SubjectSubject template. Required for Standard templates.
HtmlBodyHTML body template. HtmlBody or TextBody is required.
TextBodyPlain-text body template.
AliasUnique alias used to reference the template when sending.
TemplateTypeStandard templates render a full message; Layout templates wrap the content of Standard templates.
LayoutTemplateAlias of the Layout template that wraps this template, if any.
Create a template › Responses
The created template.
TemplateIdID of the new template.
Template name.
ActiveWhether the template is active.
Unique alias used to reference the template when sending.
TemplateTypeStandard templates render a full message; Layout templates wrap the content of Standard templates.
LayoutTemplateAlias of the Layout template that wraps this template, if any.
Push templates to another server
Copies all templates that have aliases from one server to another on the same account. Set PerformChanges to false to preview the changes without applying them. Requires an account token.
Push templates to another server › Request Body
SourceServerIDID of the server to copy templates from.
DestinationServerIDID of the server to copy templates to.
PerformChangestrue applies the push; false only previews what would change.
Push templates to another server › Responses
Templates pushed, or that would be pushed in preview mode.
TotalCountNumber of templates affected.
Templates pushed or that would be pushed.
Validate a template
Checks template syntax and returns per-part validation results, an optional rendered preview and a suggested template model.
Validate a template › Request Body
SubjectSubject template to validate.
HtmlBodyHTML body template to validate.
TextBodyPlain-text body template to validate.
Model used to render a preview. If omitted, a suggested model is returned.
InlineCssForHtmlTestRenderInline CSS when rendering the HTML preview. Defaults to true.
TemplateTypeStandard templates render a full message; Layout templates wrap the content of Standard templates.
LayoutTemplateAlias of the Layout template that wraps this template, if any.
Validate a template › Responses
Validation results.
AllContentIsValidtrue only if every supplied part is valid.
Validation result for one part of the template.
Validation result for one part of the template.
Validation result for one part of the template.
A model with the variables the template appears to use.
Get a template
Returns a template, including its subject and bodies.
path Parameters
templateIdOrAliasTemplate ID (integer) or template alias (string).
Get a template › Responses
The template.
TemplateIdUnique ID of the template.
Template name.
SubjectSubject template.
HtmlBodyHTML body template.
TextBodyPlain-text body template.
AssociatedServerIdID of the server the template belongs to.
ActiveWhether the template is active and can be used for sending.
Unique alias used to reference the template when sending.
TemplateTypeStandard templates render a full message; Layout templates wrap the content of Standard templates.
LayoutTemplateAlias of the Layout template that wraps this template, if any.
Edit a template
Updates a template. Omitted fields are left unchanged.
path Parameters
templateIdOrAliasTemplate ID (integer) or template alias (string).
Edit a template › Request Body
Template name.
SubjectSubject template.
HtmlBodyHTML body template.
TextBodyPlain-text body template.
Unique alias used to reference the template when sending.
LayoutTemplateAlias of the Layout template that wraps this template, if any.
Edit a template › Responses
The updated template.
TemplateIdID of the new template.
Template name.
ActiveWhether the template is active.
Unique alias used to reference the template when sending.
TemplateTypeStandard templates render a full message; Layout templates wrap the content of Standard templates.
LayoutTemplateAlias of the Layout template that wraps this template, if any.
Delete a template
Permanently deletes a template. A Layout template that other templates depend on cannot be deleted (error code 1130).
path Parameters
templateIdOrAliasTemplate ID (integer) or template alias (string).
Delete a template › Responses
The template was deleted.
ErrorCodePostmark API error code. 0 means the request succeeded. See the API error code table in the API description.
MessageHuman-readable result of the request.