Get document template details
Returns the complete document template including its content and custom variables.
What is returned:
- Full template metadata (name, description, language, type)
- Template content as HTML (converted from internal IDoc format)
- All custom variables defined for this template
- Creation and update timestamps with user information
Content format: The content is returned as HTML, which may include:
- Static text and formatting (headings, lists, tables, etc.)
- Variable placeholders (e.g.,
<span data-type="variable" data-id="project.name">...</span>) - Conditional sections that show/hide based on variable values
- Page breaks for document structure
Custom variables: Each template can define custom variables that extend beyond the standard system variables. These are returned with their type, default values, and whether they are required.
GET
/administration/document-templates/{id}Authorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:reador
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredResponses
200
contentstringrequiredTemplate content as HTML. The content includes static text, formatting, and variable placeholders. Variables are represented as HTML spans: `<span data-type="variable" data-id="project.name">...</span>`. The content may also include conditional sections and page breaks.
createdAtstring<date-time>requiredISO 8601 timestamp when the template was created
createdBystringrequiredUser ID of the user who created this template
descriptionstringrequiredA brief description explaining the purpose or use case of this template
documentCustomVariablesobject[]requiredArray of custom variables defined for this template. Custom variables extend beyond standard system variables and allow template-specific placeholders. Each variable includes its type, default value (if any), options (for Select/MultiSelect), and whether it is required when generating documents from this template.
idstringrequiredUnique identifier for the document template (UUID)
languagestringrequiredISO 639-1 language code for the template (e.g., "en", "de")
namestringrequiredThe name/title of the document template
typestringrequiredThe type of document this template generates
Allowed:
ProjectDocumentupdatedAtstring<date-time>requiredISO 8601 timestamp when the template was last updated
updatedByobject | nullrequiredUser ID of the user who last updated this template (null if never updated)
workspaceIdstringrequiredThe workspace ID this template belongs to
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X GET "https://leadtime.app/api/public/administration/document-templates/string" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"const response = await fetch("https://leadtime.app/api/public/administration/document-templates/string", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
});import requests
response = requests.get(
"https://leadtime.app/api/public/administration/document-templates/string",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
)Response
{
"content": "<h1>Project Contract</h1><p>Project: <span data-type=\"variable\" data-id=\"project.name\">Website Redesign</span></p>",
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"description": "Standard contract template for project agreements",
"documentCustomVariables": [
{
"description": "Client company name",
"id": "var-123",
"name": "client_name",
"options": [],
"required": true,
"type": "Text",
"value": "Acme Corp"
}
],
"id": "123e4567-e89b-12d3-a456-426614174000",
"language": "en",
"name": "Project Contract Template",
"type": "ProjectDocument",
"updatedAt": "2024-01-20T14:45:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000",
"workspaceId": "123e4567-e89b-12d3-a456-426614174000"
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions