--- title: "FormInstance" slug: "forminstance-1" updated: 2023-05-23T18:28:57Z published: 2023-05-23T18:28:57Z canonical: "docs.visualvault.com/forminstance-1" --- > ## 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. # FormInstance #### **PUT **/FormInstance/{id}/relateForm**** --- > **Relate a form instance to another form instance.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The form instance id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | relateToId | Guid | ID of the form to relate. | | relateToDocId | String | Name (DocID) of the form to relate. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 200 | OK | | 404 | Not Found | | 500 | Internal Server Error | #### **GET **/FormInstance/{id}/documents**** --- > **Get the related documents of the form instance.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The form instance id. | ##### ****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 **/FormInstance/{id}/forms**** --- > **Get the related forms of the form instance.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The form instance id. | #### **PUT **/FormInstance/{id}/relateDocument**** --- > **Relate a form instance to a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The form instance id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | relateToId | Guid | ID of the form to relate. | | relateToDocId | String | Name (DocID) of the form to relate. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 200 | OK | | 404 | Not Found | | 500 | Internal Server Error | #### **PUT **/FormInstance/{id}/relateProject**** --- > **Relate a form instance to a project.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The form instance id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | relateToId | Guid | ID of the form to relate. | | relateToProjectName | String | Name of the project to relate. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 200 | OK | | 404 | Not Found | | 500 | Internal Server Error | #### **PUT **/FormInstance/{id}/unrelateForm**** --- > **Unrelate a form instance from another form instance.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The form instance id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | relateToId | Guid | ID of the form to relate. | | relateToDocId | String | Name (DocID) of the form to relate. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 200 | OK | | 404 | Not Found | | 500 | Internal Server Error | #### **PUT **/FormInstance/{id}/unrelateDocument**** --- > **Unrelate a form instance from a document.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The form instance id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | relateToId | Guid | ID of the form to relate. | | relateToDocId | String | Name (DocID) of the form to relate. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 200 | OK | | 404 | Not Found | | 500 | Internal Server Error | #### **PUT **/FormInstance/{id}/unrelateProject**** --- > **Unrelate a form instance from a project.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The form instance id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | relateToId | Guid | ID of the form to relate. | | relateToProjectName | String | Name of the project to relate. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 200 | OK | | 404 | Not Found | | 500 | Internal Server Error | #### **DELETE **/FormInstance/{id}**** --- > **Delete a form instance.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The form instance id. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 200 | OK | | 401 | Unauthorized | | 500 | Internal Server Error | #### **PUT **api/v1/FormInstance/Upgrade**** --- > **Upgrades a form instance.** ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | request* | {UpgradeControlsRequest} | Request body containing form information. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 500 | Internal Server Error | #### **POST **/FormInstance/{id}/relatedDocumentToken**** --- > **Create a token for related document access.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The form instance id. | ##### ****Body Parameters**** | Parameter | Type | Description | | --- | --- | --- | | documentId | Guid | The ID of the document. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 201 | Created | | 409 | Conflict | #### **PUT **/FormInstance/{id}/updateOriginator**** --- > **Change the original creator of a form instance to a new user.** ##### ****Route Parameters**** | Parameter | Type | Description | | --- | --- | --- | | id* | Guid | The form instance id. | ##### ****Query Parameters**** | Parameter | Type | Description | | --- | --- | --- | | userId | Guid | UsId of the user to remove. | ##### ****Response Codes**** | Code | Description | | --- | --- | | 500 | Internal Server Error | | 200 | OK | | 403 | Forbidden | | 500 | Internal Server Error |