Skip to content

Use the documents object to query Vault documents.

To retrieve document fields and field properties, use the Retrieve All Document Fields API. To retrieve document and binder relationships, use the Retrieve Document Type Relationships API.

Query results do not include archived documents by default. In v15.0+, you can use the archived_documents object to query archived documents.

Document archive is not available in all Vaults. Learn more in Vault Help.

By default, documents and archived_documents queries return the latest document version. To retrieve all versions or retrieve the latest version that meets a condition, use the ALLVERSIONS and LATESTVERSION query target options.

The following are examples of common document queries.

Query: Retrieve the Latest Version of a Document

Section link for Query: Retrieve the Latest Version of a Document

The following query retrieves the ID and latest version number of all documents called “WonderDrug Information”:

SELECT id, minor_version_number__v, major_version_number__v FROM documents WHERE name__v = 'WonderDrug Information'

Response: Retrieve the Latest Version of a Document

Section link for Response: Retrieve the Latest Version of a Document

This response returns the latest version of the document, version 2.2.

{ "responseStatus": "SUCCESS", "responseDetails": { "pagesize": 1000, "pageoffset": 0, "size": 1, "total": 1 }, "data": [ { "id": 534, "minor_version_number__v": 2, "major_version_number__v": 2 } ] }