API Overview

The TemplateDocs API enables you to programmatically manage templates and generate documents. This RESTful API uses standard HTTP methods and returns responses in JSON format.

Service endpoint

All API requests should be made to the following base URL:

https://templatedocs.io/api

Authentication

For step-by-step authentication instructions, see the authentication documentation page.

Resources

Templates

OperationURLDescription
List TemplatesGET /v1/templatesRetrieve a list of all available templates
Get TemplateGET /v1/templates/{id}Get detailed information about a specific template
Download TemplateGET /v1/templates/{id}/contentDownload the template file
Upload TemplatePOST /v1/templatesUpload and create a new template
Update Template MetadataPUT /v1/templates/{id}Update the metadata of a specific template
Delete TemplateDELETE /v1/templates/{id}Remove a specific template
Generate DocumentPOST /v1/templates/{id}/generateCreate a document using a template and provided data

Account

OperationURLDescription
Get QuotasGET /v1/account/quotasRetrieve current usage statistics and account limits

Response Format

Success

Successful responses have a 2xx status code and their body contains the response data.

Error

Error responses have a 4xx or 5xx status code and return a JSON object with the following structure:

{
  error: {
    status: number,
    message: string,
    details: [] 
  }
}
FieldTypeDescription
error.statusnumberThe HTTP status code of the error (e.g. 400, 401, 404, etc)
error.messagestringA human-readable description of what went wrong
error.detailsarrayOptional. Array containing additional error details. The structure varies by endpoint

Common Error Codes

  • 400 - Bad request
  • 401 - Invalid or missing API key
  • 402 - Quota exceeded
  • 404 - Resource not found
  • 429 - Rate limit exceeded
  • 500 - Internal server error