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 · headerrequiredScopes:
api:reador
AuthorizationBearer token (JWT) · headerrequiredPath parameters
projectIdstringrequiredProject ID
idstringrequiredDocument ID
Responses
200Document retrieved successfully
breakdownLevelstringrequiredComponent breakdown level
Allowed:
CompleteUpToEpicsNoBreakdowncontactUserIdstringrequiredThe 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>requiredISO 8601 timestamp indicating when the document was created. Used for sorting, filtering, and audit trails.
customEditorContentobjectCustom 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[]requiredArray 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 propertiesHide properties
Array of
DocumentCustomVariableDtodescriptionstringHuman-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.
idstringVariable ID (UUID). Only required when updating an existing variable. Omit when creating a new variable.
namestringrequiredVariable 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.
requiredbooleanWhether 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
typestringrequiredThe 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:
TextLongTextNumberDateBooleanSelectMultiSelectvaluestring | 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 propertiesHide properties
One of:
string
stringnumber
numberboolean
booleanstring[]
Array of
stringstringdescriptionobjectDocument 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.
documentStylestringrequiredDocument layout style
Allowed:
LetterDocumentformattedOfferNumberobjectFully formatted offer number string. Format: [ProjectShortcode]-v[Version]-[DDMMYYYY]-[OfferNumber]. Example: WKM-1-v2-27012026-1. Only populated for Estimate type documents.
headingStylestringHeading style for document
Allowed:
NormalSequentialSequentialFromSecondLevelSequentialWithParagraphsidstringrequiredUnique identifier (UUID) for the document. Used to reference the document in subsequent API calls.
includeTocbooleanrequiredInclude table of contents
indicationModebooleanrequiredEnable indication mode
introTextobjectCustom introduction text for the offer, returned as HTML (converted from internal IDoc format). Null if not set.
languageobjectDocument language override (BCP 47 tag). Null when using workspace/organization default.
offerNumberobjectAuto-generated offer number (integer). Display format is computed as: [ProjectShortcode]-v[Version]-[DDMMYYYY]-[OfferNumber]. Only populated for Estimate type documents.
outroTextobjectCustom closing text for the offer, returned as HTML (converted from internal IDoc format). Null if not set.
projectIdstringrequiredThe ID of the project this document belongs to. Documents are always associated with a specific project.
snapshotIdstringrequiredThe 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.
statusstringrequiredDocument status
Allowed:
DraftFinalWaitingForApprovalAcceptedRejectedParkedtitleobjectThe 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).
titlePagebooleanrequiredInclude title page
typestringrequiredDocument type
Allowed:
EstimateSpecificationCustomEditorvalidUntilobjectThe 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"const response = await fetch("https://leadtime.app/api/public/projects/string/documents/string", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
});import requests
response = requests.get(
"https://leadtime.app/api/public/projects/string/documents/string",
headers={
"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"
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions
Document not found