Render a template publication

Render a template publication. View request and response details for this Samva email API endpoint.

POST
/v1/templates/{id}/publications/{publicationId}/render

Renders one immutable publication against the data you pass, formatted in the locale and timeZone you name as a send formats them, and returns the subject, preheader, HTML and plain text a send would produce. data is validated against the publication's input schema exactly as a send validates it; invalid input returns a validation error that names each failing field. Nothing is sent or stored. Unpublished workspace edits are never rendered: only a publication id renders.

x-api-key<token>

In: header

Path Parameters

id*string
Match^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$
publicationId*string
Match^tpub_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

data*

The input to render with, validated against the publication's input schema.

locale?RenderLocale
Lengthlength <= 64
timeZone?RenderTimeZone
Lengthlength <= 64

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/templates/string/publications/string/render" \  -H "Content-Type: application/json" \  -d '{    "data": {}  }'
{  "subject": "string",  "preheader": "string",  "html": "string",  "text": "string"}

Related documentation