The documents resource is the core of QualityDocD’s Node.js API. Each document record is a container that tracks its own version history — every document carries aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/juescoryisus/QualityDocD/llms.txt
Use this file to discover all available pages before exploring further.
currentVersion field showing the version with status="current", or null if none has been approved yet. All endpoints in this group require a valid Bearer token and MODULE_2 access (any role from VIEWER and above), with the exception of version creation and approval, which require MODULE_1 (OPERATOR and above).
Company scoping is enforced automatically: regular users only see documents that belong to their own company. Users with the SUPER_ADMIN role bypass this restriction and can retrieve documents across all companies.
GET /documents
Returns an array of all documents visible to the authenticated user, each with itscurrentVersion nested inline.
Auth: Bearer tokenModule access: MODULE_2 — VIEWER, COMMENTER, CONTRIBUTOR, OPERATOR, COMPANY_ADMIN, SUPER_ADMIN
Response
Unique identifier for the document.
ID of the company that owns this document.
Human-readable document title.
File format of the document (e.g.
pdf). Defaults to "pdf".User ID of the user who created the document.
Timestamp of when the document record was created.
The version with
status="current", or null if the document has not yet been approved.POST /documents
Creates a new document record along with an initial version1.0 with status="draft". The newly created document is returned with its initial version nested in currentVersion.
Auth: Bearer tokenModule access: MODULE_2 — VIEWER, COMMENTER, CONTRIBUTOR, OPERATOR, COMPANY_ADMIN, SUPER_ADMIN
Request body
The display title of the document. Must be at least 1 character.
File format of the document. Defaults to
"pdf" if omitted.Optional URL to the document file (e.g. a cloud storage link). May be
null.Plain-text content of the document. Used for full-text search indexing when the version is approved.
Optional array of keyword strings to associate with the document. Defaults to an empty array if omitted.
Response 201
Returns the created document object with the initial 1.0 draft version embedded in currentVersion.
The initial version is always created as
1.0 with status="draft". To make it visible as the active document version, it must be approved via POST /documents/:id/versions/:versionId/approve.GET /documents/:id
Retrieves a single document by ID with itscurrentVersion nested. Returns 404 if the document does not exist or belongs to a different company (for non-SUPER_ADMIN users).
Auth: Bearer tokenModule access: MODULE_2
Path parameters
The ID of the document to retrieve.
Response 200
Returns a single document object in the same shape as items from GET /documents.
Response 404
GET /documents/:id/history
Returns all versions of a document — includingdraft, current, and obsolete — sorted by insertion order. This endpoint is useful for audit trails, compliance review, and comparing content across version iterations.
Auth: Bearer tokenModule access: MODULE_2
Path parameters
The ID of the document whose history to retrieve.
Response 200
Returns an array of all version objects for the document, from earliest to most recent.
If the document ID is not found or belongs to a different company, this endpoint returns
404 { "error": "Document not found" }.