> For the complete documentation index, see [llms.txt](https://icure.gitbook.io/icure/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://icure.gitbook.io/icure/icure-data-stack/rest-api-calls/form.md).

# Form

## Create a form with the current user

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/form`

Returns an instance of created form.

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | Form |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Create a form template with the current user

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/form/template`

Returns an instance of created form template.

#### Request Body

| Name                                   | Type         | Description |
| -------------------------------------- | ------------ | ----------- |
| body<mark style="color:red;">\*</mark> | FormTemplate |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Create a batch of forms

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/form/batch`

Returns the created forms.

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | List |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Delete a form template

<mark style="color:red;">`DELETE`</mark> `https://demo.icure.cloud/rest/v2/form/template/{formTemplateId}`

#### Path Parameters

| Name                                             | Type   | Description |
| ------------------------------------------------ | ------ | ----------- |
| formTemplateId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Delete forms.

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/form/delete/batch`

Response is a set containing the ID's of deleted forms.

#### Request Body

| Name                                   | Type      | Description |
| -------------------------------------- | --------- | ----------- |
| body<mark style="color:red;">\*</mark> | ListOfIds |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Get a list of forms by parents ids

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/childrenOf/{formId}/{hcPartyId}`

Keys must be delimited by coma

#### Path Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| formId<mark style="color:red;">\*</mark>    | String |             |
| hcPartyId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets a form

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/{formId}`

#### Path Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| formId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets the most recent form with the given logicalUuid

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/logicalUuid/{logicalUuid}`

#### Path Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| logicalUuid<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets the most recent form with the given uniqueId

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/uniqueId/{uniqueId}`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| uniqueId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets a form template by guid

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/template/{formTemplateId}`

#### Path Parameters

| Name                                             | Type   | Description |
| ------------------------------------------------ | ------ | ----------- |
| formTemplateId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all form templates for current user

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/template`

#### Query Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| loadLayout | Boolean |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets a form template

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/template/{specialityCode}/guid/{formTemplateGuid}`

#### Path Parameters

| Name                                               | Type   | Description |
| -------------------------------------------------- | ------ | ----------- |
| formTemplateGuid<mark style="color:red;">\*</mark> | String |             |
| specialityCode<mark style="color:red;">\*</mark>   | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Get a list of forms by ids

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/form/byIds`

Keys must be delimited by coma

#### Request Body

| Name                                   | Type      | Description |
| -------------------------------------- | --------- | ----------- |
| body<mark style="color:red;">\*</mark> | ListOfIds |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all forms with given logicalUuid

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/all/logicalUuid/{logicalUuid}`

#### Path Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| logicalUuid<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all forms by uniqueId

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/all/uniqueId/{uniqueId}`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| uniqueId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all form templates

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/template/bySpecialty/{specialityCode}`

#### Path Parameters

| Name                                             | Type   | Description |
| ------------------------------------------------ | ------ | ----------- |
| specialityCode<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| loadLayout | Boolean |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## List forms found By Healthcare Party and secret foreign keys.

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/byHcPartySecretForeignKeys`

Keys must be delimited by coma

#### Query Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| hcPartyId<mark style="color:red;">\*</mark>   | String |             |
| secretFKeys<mark style="color:red;">\*</mark> | String |             |
| healthElementId                               | String |             |
| planOfActionId                                | String |             |
| formTemplateId                                | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## List form stubs found By Healthcare Party and secret foreign keys.

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/form/byHcPartySecretForeignKeys/delegations`

Keys must be delimited by coma

#### Query Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| hcPartyId<mark style="color:red;">\*</mark>   | String |             |
| secretFKeys<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Modify a form

<mark style="color:orange;">`PUT`</mark> `https://demo.icure.cloud/rest/v2/form`

Returns the modified form.

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | Form |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Modify a batch of forms

<mark style="color:orange;">`PUT`</mark> `https://demo.icure.cloud/rest/v2/form/batch`

Returns the modified forms.

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | List |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Delegates a form to a healthcare party

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/form/delegate/{formId}`

It delegates a form to a healthcare party. Returns the form with the new delegations.

#### Path Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| formId<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | List |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Update delegations in form.

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/form/delegations`

Keys must be delimited by coma

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | List |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Update a form template's layout

<mark style="color:orange;">`PUT`</mark> `https://demo.icure.cloud/rest/v2/form/template/{formTemplateId}/attachment/multipart`

#### Path Parameters

| Name                                             | Type   | Description |
| ------------------------------------------------ | ------ | ----------- |
| formTemplateId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Modify a form template with the current user

<mark style="color:orange;">`PUT`</mark> `https://demo.icure.cloud/rest/v2/form/template/{formTemplateId}`

Returns an instance of created form template.

#### Path Parameters

| Name                                             | Type   | Description |
| ------------------------------------------------ | ------ | ----------- |
| formTemplateId<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                   | Type         | Description |
| -------------------------------------- | ------------ | ----------- |
| body<mark style="color:red;">\*</mark> | FormTemplate |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}
