Skip to content

Get All Templates

Retrieve a list of all templates in your account using the Docstron API. This endpoint returns all templates with their metadata, content, and status.

GET https://api.docstron.com/v1/templates

This endpoint requires authentication using a Bearer token. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY
Terminal window
curl --location 'https://api.docstron.com/v1/templates' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data ''

200 - Success Response

{
"success": true,
"message": "Request successful",
"data": [
{
"template_id": "template-5425dc65-3b11-48a1-8761-a48f3461b8cc",
"application_id": "app-7b4d78fb-820c-4ca9-84cc-46953f210301",
"name": "Template 1",
"is_active": true,
"created_at": "2025-10-16T14:35:13",
"updated_at": "2025-10-16T14:35:26",
"content": "<h1>Hello {{ customer_name }}</h1><p>Amount is {{ amount }}</p>"
},
{
"template_id": "template-8c043edf-fa70-4e51-a8a2-36f67958ca16",
"application_id": "app-7b4d78fb-820c-4ca9-84cc-46953f210301",
"name": "Template 2",
"is_active": false,
"created_at": "2025-10-12T17:06:33",
"updated_at": "2025-10-12T17:06:33",
"content": "<h1>Hello {{ customer_name }}</h1><p>Amount is {{ amount }}</p>",
"extra_css": null
}
]
}
FieldTypeDescription
successbooleanIndicates if the request was successful
messagestringA message describing the response
dataarrayArray of template objects
data[].template_idstringUnique identifier of the template
data[].application_idstringThe application this template belongs to
data[].namestringName of the template
data[].is_activebooleanWhether the template is active and can be used
data[].created_atstringTimestamp when the template was created (ISO 8601 format)
data[].updated_atstringTimestamp when the template was last updated (ISO 8601 format)
data[].contentstringHTML content of the template with placeholders
data[].extra_cssstringAdditional CSS styling for the template (optional)

500 - Internal Server Error

Returned when an unexpected server error occurs while retrieving templates.

{
"success": false,
"message": "Failed to get templates.",
"data": []
}

Common causes:

  • Temporary server issue
  • Database connectivity problem
  • Service maintenance

Solution: Wait a few moments and retry the request. If the problem persists, contact support@docstron.com.

If you have questions about applications or need assistance:

  • 📧 Email: support@docstron.com
  • 💬 Live Chat: Available in your dashboard
  • 📚 Documentation: You’re reading it!