api-docs-icon

Create Template

POST
/ api/ v1/ templates

Creating templates via the API can be done in two ways. One way is to pass in back and front parameters. These will define the full size images to be used for the front and back of the piece. These will not contain any other text or images. The other way is to pass in the full HTML of the piece based on Postalytics template standards. Note that on either of these methods if you override the proofing process by sending is_proofed = true, Postalytics can take no responsibility for templates not created properly.

object
is_full_html
boolean
required
default: true

If is_full_html is set to true, the entire html is sent in as the html property. If set to false, full sized background images will be sent in as front and back properties

Example:
true
is_proofed
boolean
required
default: false

Indicates whether the template is considered proofed or not. Note that setting this to true bypasses all the guardrails in the web app for making sure templates are created properly. If set to true Postalytics takes no responsibility for pieces sent out with incorrect formatting

name
string
required

Name of the template.

Example:
The Architect
size
string
required

Size of the template being created. Options are: 0 = letter, 1 = 4x6 postcard, 2 = 6x9 postcard, 3 = 6x11 postcard, 6 = 12x9 bifold, 7 = 6x18 bifold

Example:
0
back
string
nullable

The image url of the full sized background for the back or the back content of a letter. Refer to the help docs for proper image sizing.

Example:
https://some.url.com/back.jpg
count
integer (int32)
default: 0

The number of pages in the template if this is a letter.

Example:
2
created_date
string
nullable

The date and time when the template was created.

Example:
1999-02-19T12:00:00.00:00
font_family
string
nullable

Font family to be used within template.

Example:
sans-serif
front
string
nullable

The image url of the full sized background for the front or the front content of a letter. Refer to the help docs for proper image sizing.

Example:
https://some.url.com/front.jpg
html
string
nullable

If is_full_html is set to true, the full HTML defined here will be used tp create the template. The HTML format is very specific and this feature should be used carefully. For detailed samples of specific HTML for the various formats, please contact support@postalytics.com

Example:
full html here
is_double_sided
boolean
default: false

Indicates whether the template is double-sided if this is a letter.

Example:
false
template_id
integer (int32)

The unique identifier of the template. This will be returned on a GET but is not required for a POST

Example:
10142067
thumbnail
string
nullable

Thumbnail path of the template front. This will be returned on a GET but is not required for a POST.

Example:
https://some.url.com/thumb_front.jpg
thumbnail_back
string
nullable

Thumbnail path of the template back. This will be returned on a GET but is not required for a POST.

Example:
https://some.url.com/thumb_back.jpg

Response

application/json
object
CreatedDate
string (date-time)

The date and time when the template was created.

Example:
1999-02-19T12:00:00.00:00
TemplateId
integer (int32)

The unique id of the template.

Example:
10142067

Code Examples

Response