---
title: "POST /document-versions"
method: POST
path: "/document-versions"
tags: ["Query"]
---

# POST /document-versions

`POST /document-versions`

This endpoint must be called when querying the latest versions for multiple documents. It's an aggregate endpoint that should make periodic polling of a collection of documents easier. Servers must also support the ETag header for this endpoint, so clients may specifiy to receive a response object in case of changes on the server since the last query. It will return a list of DocumentVersion objects, where each DocumentVersion represents the latest version for each given document on the server.

## Request body

- DocumentQuery — An array of document IDs to track
  - `document_ids` string[], required

## Response `200`

- DocumentQueryResult — The versions array contains all the latest document version objects.
  - `versions` DocumentVersion[], required
    - `links` DocumentVersionLinks, required — The document_details property represents an url that should be opened in the system browser. It leads to a page on the CDE where users can view or edit document details
      - `document_version` LinkData, required
        - `url` string, required
      - `document_version_metadata` LinkData, required
        - `url` string, required
      - `document_version_download` LinkData, required
        - `url` string, required
      - `document_versions` LinkData, required
        - `url` string, required
      - `document_details` LinkData
        - `url` string, required
    - `version_number` string, required — A human readable version number. This is not expected to be in any specific format across CDEs and may hold any value
    - `version_index` integer, required — A machine readable sequence number of the version of the document. The sequence must be ordered, so that newer versions have higher values than previous ones. Each version index must be unique for that document, but there may be gaps in the sequence
    - `creation_date` string, date-time, required — The creation date of the document revision
    - `title` string, required
    - `file_description` FileDescription, required
      - `name` string, required
      - `size_in_bytes` integer, required
    - `document_id` string, required

## Changes

- **2022-04-11** `587e089ee996` — 2 warning
  - removed the request property `latest_only`
  - removed the request property `since`
- **2022-04-04** `12bb2ad9cc6b` — 1 info
  - added the new optional request property `latest_only`
- **2022-04-04** `307e62e8cf00` — 2 breaking
  - the request property `since` became required
  - the `since` request property's minLength was increased from `0` to `1`
- **2022-04-04** `700cc8cbf16f` — 1 info
  - added the new optional request property `since`
- **2022-03-28** `92ccd43edee4` — 1 info
  - endpoint added

[Full history](https://skmtc.dev/buildingsmart/apis/opencde-documents-api/changes/document-versions/post.md)

---

[API](https://skmtc.dev/buildingsmart/apis/opencde-documents-api.md) · [All operations](https://skmtc.dev/buildingsmart/apis/opencde-documents-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/buildingsmart/opencde-documents-api/revisions/aa900ac7bbc7/schema)
