Document Templates
List document templates and get template metadata via the API.
Document Templates API
Read document template metadata. Template content is not exposed via the API. All endpoints require an API token with the templates.view ability.
List Templates
GET /api/v1/document-templates — Permission: templates.view
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | No | Filter by type: invoice, proposal, contract, quote, receipt |
search | string | No | Search by template name |
per_page | integer | No | Results per page, 1–100 (default: 25) |
Example Request
curl -X GET "https://your-domain.com/api/v1/document-templates?type=invoice" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"const response = await fetch("https://your-domain.com/api/v1/document-templates?type=invoice", {
headers: {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
});
const data = await response.json();$ch = curl_init("https://your-domain.com/api/v1/document-templates?type=invoice");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_TOKEN",
"Accept: application/json",
],
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);import requests
response = requests.get(
"https://your-domain.com/api/v1/document-templates?type=invoice",
headers={
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
)
data = response.json()Example Response
{
"data": [
{
"id": 5,
"name": "Standard Invoice",
"type": "invoice",
"description": "Default invoice template with line items and payment terms",
"is_default": true,
"is_active": true,
"created_at": "2025-01-05T10:00:00.000000Z",
"updated_at": "2025-03-12T14:00:00.000000Z"
}
],
"meta": { "current_page": 1, "last_page": 1, "per_page": 25, "total": 1 },
"links": { "first": "...", "last": "...", "prev": null, "next": null }
}
Get Template
GET /api/v1/document-templates/{id} — Permission: templates.view
Returns the same shape as a single item in the list response. Template content (blocks, settings) is not included.
Was this article helpful?