Developer Documentation
Feedback

Template API

Introduction

The template API renders images or PDFs from templates you've created. The following endpoints are available:

Base URL
https://api.tailrender.com
MethodURLCreditsDescription
POST/template0Create / update a template
DELETE/template?templateName={templateName}0Delete a template by its name
POST/template/render1Render a template
GET/template/render/{renderId}0Get the result of a previously rendered file

Basic usage

Create a template

  • POST /template
curl
curl --location --request POST 'https://api.tailrender.com/template' \
--header 'Authorization: {{ YOUR_API_KEY_HERE }}' \
--header 'Content-Type: application/json' \
--data-raw '{
"templateName": "my-new-template",
"type": "pdf",
"html": "<div class=\"text-green-600\">My first template is named {{ title }}.</div>"
}'
  • POST /template response
json
{
"success": true,
"templateName": "my-new-template"
}

Render a template

  • POST /template/render
curl
curl --location --request POST 'https://api.tailrender.com/template/render' \
--header 'Authorization: {{ YOUR_API_KEY_HERE }}' \
--header 'Content-Type: application/json' \
--data-raw '{
"templateName": "my-new-template",
"props": {
"title": "My first template"
}
}'
  • POST /template/render response
json
{
"id": "E1dQthkkGbacfL6prXDg",
"templateName": "my-new-template",
"props": {
"title": "My first template"
},
"status": "COMPLETED",
"result": {
"url": "https://tailrender-api.s3.amazonaws.com/pdf/E1dQthkkGbacfL6prXDg.pdf",
"pdfUrl": "https://tailrender-api.s3.amazonaws.com/pdf/E1dQthkkGbacfL6prXDg.pdf"
}
}