Skip to content

Render the draft or a version with test data (nothing is sent)

POST
/api/v1/workspaces/{workspace}/transactional/templates/{template}/preview
curl --request POST \
--url https://reputecast.example.com/api/v1/workspaces/acme-newsletter/transactional/templates/password-reset/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "data": { "additionalProperty": "example" }, "html": "example", "mjml": "example", "plainText": "example", "preheader": "example", "subject": "example", "testData": "example", "to": { "email": "[email protected]", "name": "Sam Rivera" }, "variables": [ { "default": "example", "description": "example", "name": "reset_url", "required": true, "sample": "example", "sensitive": true, "type": "text" } ], "version": "draft" }'

Permission: transactional:view

workspace
required

Workspace slug

string
/^[a-z0-9][a-z0-9-]{1,62}$/

Workspace slug

template
required

The template’s ID, such as password-reset, or its UUID

string
<= 64 characters

The template’s ID, such as password-reset, or its UUID

Media typeapplication/json
object
data

Data to render with instead of a test data set

object
key
additional properties
html
string
<= 2500000 characters
mjml
string
<= 2000000 characters
plainText
string
<= 500000 characters
preheader
string
<= 500 characters
subject
string
<= 998 characters
testData

The name of a test data set

string
<= 80 characters
to
object
email
required
string
<= 254 characters
name
string
<= 200 characters
variables
Array<object>
<= 200 items
object
default
string
<= 4000 characters
description
string
<= 300 characters
name
required
string
>= 1 characters <= 64 characters /^[A-Za-z_][A-Za-z0-9_]*$/
required
required
boolean
sample
string
<= 4000 characters
sensitive
required

Never stored: logs and stored content show ••••••

boolean
type
required
string
Allowed values: text number boolean date url list object
version

Draft (default), live, or a version number

string

OK

Media typeapplication/json
object
defaults
required
Array<string>
fromEmail
required
string
fromName
required
string
html
required
string
missing
required
Array<string>
ok
required
boolean
preheader
required
string
problem
string
replyTo
required
string
sizeBytes
required
integer format: int64
subject
required
string
text
required
string
version
required
string

Example generated

{
"defaults": [
"example"
],
"fromEmail": "example",
"fromName": "example",
"html": "example",
"missing": [
"example"
],
"ok": true,
"preheader": "example",
"problem": "example",
"replyTo": "example",
"sizeBytes": 1,
"subject": "example",
"text": "example",
"version": "example"
}

Error

Media typeapplication/problem+json
object
code

Stable error code, e.g. permission_denied

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object>
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

helpers

Members who hold the missing permission

Array<string>
instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
meta
object
key
additional properties
permission

The missing permission key

string
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank

Example

{
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}