--- title: "Documents" slug: "documents-2" updated: 2023-05-25T01:57:41Z published: 2023-05-25T01:57:41Z canonical: "docs.visualvault.com/documents-2" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.visualvault.com/llms.txt > Use this file to discover all available pages before exploring further. # Documents #### **GET **/documents**** --- > **Returns a set of documents based on a query string.** ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | indexFields | String | Index field options. - include: Include index fields. - only: Return only index fields. | | sort | String | The name of a data column to sort by. | | sortDir | String | Sort direction. - asc: Ascending order - desc: Descending order | | q | String | A VisualVault REST API Data Query. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 400 | Bad Request | #### **GET **/documents/{id}**** --- > **Returns a requested document by Document ID.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | #### **DELETE **/documents/{id}**** --- > **Deletes the requested document by Document ID.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | purge | Bool | Permanently delete documents? (Purged documents cannot be recovered.) | #### **POST **/documents**** --- > **Creates a new document.** **If 'allowZeroByteFile' is being provided, then the following fields are required: allowNoFile, filename, and fileLength ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | allowNoFile** | Bool | Allows a document to be created with no attached file (or a file containing 0 bytes). | | folderId* | Guid | The folder ID. | | name* | String | The customer name. | | description | String | Document description. | | revision | String | Document revision number. | | documentState | String | Document status. - Unreleased (0) - Released (1) - Pending (2) | | checkInDocumentState | String | Document status. - Unreleased (0) - Released (1) - Pending (2) | | fileLength** | String | Size of the file (in bytes). | | filename** | String | Name of the file. | | indexFields | {IndexField} | Index field names and values as a JSON array or object string. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 400 | Bad Request | #### **POST **/documents/{id}/copy**** --- > **Copies a document to another folder.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | folderId | Guid | The folder ID. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 404 | Not Found | #### **PUT **/documents/{id}/move**** --- > **Moves a document to another folder.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | folderId* | Guid | The folder ID. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 404 | Not Found | #### **PUT **/documents/{id}**** --- > **Updates information about a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | name* | String | The document name. | | displayRev* | String | The document display revision. | | archive | String | Document options. - Active (0) - Archived (1) - Deleted (2) - Purged (3) | | state | String | State. | | description | String | Document description. | | keywords | String | Document keywords. | | comments | String | Document comments. | | abstact | String | Document abstract. NOTE: Parameter name is a known typo. | #### **PUT **/documents/{id}/rename**** --- > **Renames a document or all revisions of a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | renameAllRevisions | Bool | Rename all revisions of the document? | | newName* | String | New name of the document. | #### **PUT **/documents/{id}/archive**** --- > **Archives a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | #### **PUT **/documents/{id}/revision/{childId}/state**** --- > **Updates document state by revision.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | | childId* | Guid | The revision id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | state | String | Document status. - Unreleased (0) - Released (1) - Pending (2) | | checkInDocumentState | String | Document status. - Unreleased (0) - Released (1) - Pending (2) | #### **PUT **/documents/{id}/status**** --- > **Check in or check out a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | checkIn | String | Check in status. - CheckedIn (0) - CheckedOut (1) | | status | String | Check in status. - CheckedIn (0) - CheckedOut (1) | #### **GET **/documents/{id}/revisions**** --- > **Return all revisions of a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | offset | String | Sets an offset to the start of the search. | | limit | Int | Sets a limit to the number of values returned. | #### **GET **/documents/{id}/revisions/{childid}**** --- > **Return a specific document revision.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | | childId* | Guid | The revision id. | #### **GET **/documents/revisions/{id}**** --- > **Return a specific document revision.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document revision id. | #### **DELETE **/documents/revisions/{id}**** --- > **Delete the requested document revision.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document revision id. | #### **GET **/documents/{id}/revisions/{childid}/indexfields**** --- > **Return all index field information for a document revision.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | | childId* | Guid | The revision id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | offset | String | Sets an offset to the start of the search. | | limit | Int | Sets a limit to the number of values returned. | #### **GET **/documents/{id}/revisions/{childId}/indexfields/{thirdId}**** --- > **Return information for a specific index field for a document revision.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | | childId* | Guid | The revision id. | | thirdId* | Guid | The index field id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | offset | String | Sets an offset to the start of the search. | | limit | Int | Sets a limit to the number of values returned. | #### **GET **/documents/{id}/indexfields**** --- > **Return the list of assigned index fields for a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | metaonly | Bool | Return only index field metadata. | #### **PUT **/documents/{id}/indexfields**** --- > **Update the index field values for a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | indexFields* | String | Index field names and values as a JSON array or object string. | #### **GET **/documents/{id}/indexfields/{childid}**** --- > **Retrieve a specific index field from a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | | childId* | Guid | The index field id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | metaonly | Bool | Return only index field metadata. | #### **PUT **/documents/{id}/indexfields/{childid}**** --- > **Update a specific index field value for a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | | childId* | Guid | The index field id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | value* | String | Index field value. | #### **PUT **/documents/{id}/relatedocument**** --- > **Relate a document to another document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The ID of the document to relate. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | relateToId | Guid | The ID of the document to relate to. | | relateType | String | The relation type. - None (0) - Parent (1) - Child (2) - Peer (3) - Project (4) - Document_Forms (5) - Form_Documents (6) - Form_Forms (7) - Project_Forms (8) - Project_Documents (9) | #### **GET **/documents/{id}/approvals**** --- > **Request active document approvals.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | uid | Guid | UsId of the associated user. | #### **POST **/documents/{id}/approvals**** --- > **No Description.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | users | String | The users to assign the approval. | | baseUrl* | String | Base URL. | | requestTitle | String | Title of the approval request. | | message | String | Message to include. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 400 | Bad Request | #### **GET **/documents/approvals/{id}**** --- > **Request an active document approval.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | int | The approval id. | #### **PUT **/documents/approvals/{id}**** --- > **Update an active document approval.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | int | The approval id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | cancel | Bool | Cancel the approval. | | reject | Bool | Reject the approval. | | comment | String | Approval comment. | | approve | Bool | Approve the approval. | | resubmit | Bool | Resubmit the approval. | | reassign | Bool | Reassign the approval. | | baseUrl | String | Base URL. | | user* | String | UsId of the associated user. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 400 | Bad Request | #### **GET **/documents/{id}/alerts**** --- > **Get all current document alert subscriptions.** No Parameters. #### **POST **/documents/{id}/alerts/{eventId}**** --- > **Subscribe a user to a document alert.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | | eventId* | Guid | The event id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | usId* | Guid | UsId of the associated user. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 400 | Bad Request | #### **DELETE **/documents/{id}/alerts/{eventId}**** --- > **Cancel a user subscription from a document alert.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | | eventId* | Guid | The event id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | usId* | Guid | UsId of the associated user. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 400 | Bad Request | | 404 | Not Found | #### **GET **/documents/{id}/ocr**** --- > **Get OCR properties for a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | #### **PUT **/documents/{id}/ocr/status**** --- > **Update the OCR status of a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The document id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | ocrErrorCode | String | OCR process error code. - None (0) - ErrorThrown (1) - OcrProcessingError (2) - OcrOutputSaveError (3) - CheckinError (4) | | ocrStatus* | String | OCR process progress status. - None (0) - Success (1) - SuccessNoTextExtracted (2) - Failure (3) - FailureNoRetry (4) - ResultingDocumentFromSuccess (5) | #### **POST **/documents/CreateDocumentZipFile**** --- > **Download a document compressed in a zip file.** ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | documentDhIds | {DhId} | List of document DhIds. | #### **GET **/documents/GetDocumentZipFileStatus**** --- > **Check the current compression status of a document file.** ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | downloadKey | Guid | Download Key. | #### **GET **/lastDocuments**** --- > **Returns the user's last documents.** No Parameters. #### **GET **/frequentDocuments**** --- > **Returns the user's recent documents.** No Parameters. #### **GET **/documentListContextMenu/{documentId}**** --- > **Returns the document list widget context menu.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | documentId* | string | The document id. |