Zum Inhalt springen
Leadtime
Deutsch
Esc
navigateopen⌘Jpreview

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 · headerrequired
Scopes:api:read
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
idstringrequired
Responses
200
contentstringrequired
Template 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>required
ISO 8601 timestamp when the template was created
createdBystringrequired
User ID of the user who created this template
descriptionstringrequired
A brief description explaining the purpose or use case of this template
documentCustomVariablesobject[]required
Array 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.
idstringrequired
Unique identifier for the document template (UUID)
languagestringrequired
ISO 639-1 language code for the template (e.g., "en", "de")
namestringrequired
The name/title of the document template
typestringrequired
The type of document this template generates
Allowed:ProjectDocument
updatedAtstring<date-time>required
ISO 8601 timestamp when the template was last updated
updatedByobject | nullrequired
User ID of the user who last updated this template (null if never updated)
workspaceIdstringrequired
The 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"
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"
}