Required format
frontHtmlandbackHtmlmust both be valid HTML strings.- Recommended size: exactly
6in x 4inpostcard canvas. - 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: what you want on postcard back
Safe baseline template
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
@page {
size: 6in 4in;
margin: 0;
}
html,
body {
margin: 0;
padding: 0;
}
.card {
width: 6in;
height: 4in;
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