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
Operation | URL | Description |
---|---|---|
List Templates | GET /v1/templates | Retrieve a list of all available templates |
Get Template | GET /v1/templates/{id} | Get detailed information about a specific template |
Download Template | GET /v1/templates/{id}/content | Download the template file |
Upload Template | POST /v1/templates | Upload and create a new template |
Update Template Metadata | PUT /v1/templates/{id} | Update the metadata of a specific template |
Delete Template | DELETE /v1/templates/{id} | Remove a specific template |
Generate Document | POST /v1/templates/{id}/generate | Create a document using a template and provided data |
Account
Operation | URL | Description |
---|---|---|
Get Quotas | GET /v1/account/quotas | Retrieve 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: []
}
}
Field | Type | Description |
---|---|---|
error.status | number | The HTTP status code of the error (e.g. 400, 401, 404, etc) |
error.message | string | A human-readable description of what went wrong |
error.details | array | Optional. Array containing additional error details. The structure varies by endpoint |
Common Error Codes
400
- Bad request401
- Invalid or missing API key402
- Quota exceeded404
- Resource not found429
- Rate limit exceeded500
- Internal server error