Preview a template
const url = 'https://api.velumrelay.email/v1/templates/example/preview';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"data":{"name":"Ada"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.velumrelay.email/v1/templates/example/preview \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "data": { "name": "Ada" } }'Renders the saved template (inside its layout, if it has one) with data. Nothing is sent or stored.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Use a lowercase letter first, then a-z, 0-9 and _ (up to 48 characters)
Request Body
Section titled “Request Body”object
Template variables to render with.
object
Layouts only: one of your templates to render inside the layout. Leave out for placeholder content.
Example
{ "data": { "name": "Ada" }}Responses
Section titled “Responses”The rendered email.
object
Example generated
{ "subject": "example", "html": "example", "text": "example"}Headers
Section titled “Headers”Example
req_3kTMd9vXq2LwB8nYpR4sZaUnique ID of this request (req_ + 22 characters). Include it when you contact support.
Missing or invalid management key.
object
What went wrong, in plain words.
Example
{ "error": "invalid or missing management key"}No template with that ID in your account.
object
What went wrong, in plain words.
Example
{ "error": "template not found"}The template couldn’t be rendered with this data.
object
What went wrong, in plain words.
Example
{ "error": "render failed: …"}Rate limit exceeded (20 requests per second, bursts up to 40, per key). Wait for Retry-After seconds, then retry.
object
What went wrong, in plain words.
Example
{ "error": "rate limit exceeded"}Headers
Section titled “Headers”Example
1Example
req_3kTMd9vXq2LwB8nYpR4sZaUnique ID of this request (req_ + 22 characters). Include it when you contact support.