Skip to content
Leadtime
English
Esc
navigateopen⌘Jpreview

Get document details

What is returned: Complete details for a specific project document, including all metadata, content, and configuration.

Content format:

  • Description and custom editor content are returned as HTML (converted from internal IDoc format)
  • This allows direct display in web browsers or further HTML processing
  • Original formatting, headings, lists, and tables are preserved

Custom variables: If the document uses custom variables (defined in templates), all variable definitions and their current values are included:

  • Variable name, type, and description
  • Current value (formatted according to variable type)
  • Available options (for Select/MultiSelect types)
  • Required flag indicating if value must be provided

Document configuration:

  • Layout options: table of contents, title page, indication mode
  • Heading style: controls how headings are numbered (normal, sequential, sequential from level 2, sequential with paragraph signs)
  • Type and status: document category and workflow state
  • Project version binding: which project snapshot this document is based on

Use cases:

  • Display document in a viewer/editor interface
  • Show document metadata and properties
  • Edit document content and variables
  • Export document to DOCX format
  • Track document status and history
GET/projects/{projectId}/documents/{id}
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:read
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
projectIdstringrequired
Project ID
idstringrequired
Document ID
Responses
200Document retrieved successfully
breakdownLevelstringrequired
Component breakdown level
Allowed:CompleteUpToEpicsNoBreakdown
contactUserIdstringrequired
The user ID of the contact person assigned to this document. This person appears as the addressed recipient in the document header and recipient fields. Empty string if no contact person is assigned.
createdAtstring<date-time>required
ISO 8601 timestamp indicating when the document was created. Used for sorting, filtering, and audit trails.
customEditorContentobject
Custom document content for CustomEditor document type, returned as HTML (converted from internal IDoc format). Contains rich formatting: headings, lists, tables, links, variables, conditional sections. Null if no custom content was provided.
customVariablesDocumentCustomVariableDto[]required
Array of custom variables with their current values. Each variable includes its definition (name, type, description, options) and the current value formatted according to the variable type. Empty array if no custom variables are defined.
Show properties
Array of DocumentCustomVariableDto
descriptionstring
Human-readable label/description for this variable. This is displayed to users when they are prompted to fill in the variable value when generating a document.
idstring
Variable ID (UUID). Only required when updating an existing variable. Omit when creating a new variable.
namestringrequired
Variable name/key used to reference this variable in the template content. Use lowercase with underscores (e.g., "client_name", "project_budget"). This name is used in the variable reference: custom.variable_name.
optionsstring[]
Available options for Select or MultiSelect variable types. For Select, users choose one option. For MultiSelect, users can choose multiple options. This field is ignored for other variable types.
requiredboolean
Whether this variable must be filled in when generating a document from the template. If true, users cannot proceed without providing a value. If false, the variable is optional.
default: false
typestringrequired
The data type of this variable. Determines what kind of input is expected and how the value is validated. Available types: Text (short text), LongText (multi-line text), Number (numeric value), Date (date/time), Boolean (true/false), Select (single choice from options), MultiSelect (multiple choices from options).
Allowed:TextLongTextNumberDateBooleanSelectMultiSelect
valuestring | number | boolean | string[]
Default value for this variable. The type of value depends on the variable type: - Text/LongText/Select: string - Number: number - Boolean: boolean - Date: ISO 8601 date string (e.g., "2024-01-15") - MultiSelect: array of strings This value is pre-filled when generating a document, but users can override it.
Show properties
One of:
string
string
number
number
boolean
boolean
string[]
Array of string
string
descriptionobject
Document description or introduction text, returned as HTML (converted from internal IDoc format). Contains rich formatting: headings, lists, tables, links. Null if no description was provided.
documentStylestringrequired
Document layout style
Allowed:LetterDocument
formattedOfferNumberobject
Fully formatted offer number string. Format: [ProjectShortcode]-v[Version]-[DDMMYYYY]-[OfferNumber]. Example: WKM-1-v2-27012026-1. Only populated for Estimate type documents.
headingStylestring
Heading style for document
Allowed:NormalSequentialSequentialFromSecondLevelSequentialWithParagraphs
idstringrequired
Unique identifier (UUID) for the document. Used to reference the document in subsequent API calls.
includeTocbooleanrequired
Include table of contents
indicationModebooleanrequired
Enable indication mode
introTextobject
Custom introduction text for the offer, returned as HTML (converted from internal IDoc format). Null if not set.
languageobject
Document language override (BCP 47 tag). Null when using workspace/organization default.
offerNumberobject
Auto-generated offer number (integer). Display format is computed as: [ProjectShortcode]-v[Version]-[DDMMYYYY]-[OfferNumber]. Only populated for Estimate type documents.
outroTextobject
Custom closing text for the offer, returned as HTML (converted from internal IDoc format). Null if not set.
projectIdstringrequired
The ID of the project this document belongs to. Documents are always associated with a specific project.
snapshotIdstringrequired
The project version (snapshot) ID that this document is based on. This ensures the document content is tied to a specific project state for traceability and audit purposes.
statusstringrequired
Document status
Allowed:DraftFinalWaitingForApprovalAcceptedRejectedParked
titleobject
The title/name of the document. This appears in document lists, headers, and exports. Null for Letter-style Estimate documents (title is not used in letter format).
titlePagebooleanrequired
Include title page
typestringrequired
Document type
Allowed:EstimateSpecificationCustomEditor
validUntilobject
The date until which this offer is valid. Used for Letter-style offers to indicate expiration date. Null if not set.
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
404Document not found
Request
curl -X GET "https://leadtime.app/api/public/projects/string/documents/string" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
{
  "breakdownLevel": "Complete",
  "contactUserId": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2024-01-15T10:30:00Z",
  "customEditorContent": "<h1>Custom Document Content</h1><p>Details here...</p>",
  "customVariables": [
    {
      "description": "Client Company Name",
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "client_name",
      "options": [
        "Option 1",
        "Option 2",
        "Option 3"
      ],
      "required": false,
      "type": "Text",
      "value": "Acme Corp"
    }
  ],
  "description": "<p>Quarterly estimate for client approval</p>",
  "documentStyle": "Letter",
  "formattedOfferNumber": "WKM-1-v2-27012026-1",
  "headingStyle": "Sequential",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "includeToc": true,
  "indicationMode": false,
  "introText": "<p>Thank you for your inquiry. We are pleased to submit the following offer:</p>",
  "language": "de",
  "offerNumber": 1,
  "outroText": "<p>This offer is non-binding. We thank you for your interest.</p>",
  "projectId": "123e4567-e89b-12d3-a456-426614174000",
  "snapshotId": "123e4567-e89b-12d3-a456-426614174000",
  "status": "Draft",
  "title": "Q4 2024 Project Estimate",
  "titlePage": true,
  "type": "Estimate",
  "validUntil": "2024-02-15T00:00:00Z"
}