Required format
- Default sends should use
imageUrl,imageOrientation,messageText, andmessageFontFamily. frontHtml/backHtmlare advanced overrides for template output or custom HTML.- Recommended size:
6.25in x 4.25infor full-bleed Lob output, with important content kept inside the6in x 4intrim. - Max size per HTML field:
2,000,000characters.
Rendering behavior
- Send endpoint accepts user-facing
frontHtmlandbackHtml. - Internally, print provider field mapping is handled by tinypostcard.
- You should always pass payload fields using normal names:
frontHtml: what you want on postcard frontbackHtml: message content for the postcard back
- Do not draw the recipient address, postage, postal barcode, or stamp box into either HTML field. Provide recipient data in
to; tinypostcard and the print provider handle mailing/addressing separately. - Image fronts are best sent with
imageUrl. Do not simulate requested generated artwork with HTML/CSS shapes. - For public agent/API payloads, tinypostcard places
backHtmlin the safe left message zone, about2.3165in x 3.75in, and reserves Lob’s lower-right3.2835in x 2.375inno-ink area for address, postage, barcode, and return-address handling. - For handwritten-style notes, set CSS
font-familyto one of the bundled fonts:"tpc-letters-home","tpc-ugly-dave","tpc-ugly-dave-alternates","tpc-marina-script", or"Dancing Script".
Safe baseline template
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
@page {
size: 6.25in 4.25in;
margin: 0;
}
html,
body {
margin: 0;
padding: 0;
}
.card {
width: 6.25in;
height: 4.25in;
overflow: hidden;
}
</style>
</head>
<body>
<div class="card">Hello postcard</div>
</body>
</html>Reusing existing public templates
Use template endpoints to source production-safe HTML:
GET /api/v1/templates?scope=sharedGET /api/v1/templates/{templateId}/html
This is the fastest way for agents to avoid HTML formatting issues.
Last updated on