# Creating new Policy

## Creates a new policy.

<mark style="color:green;">`POST`</mark> `/policy`

Creates a new policy by wizard. Only users with the Standard Registry role are allowed to make the request. security:

#### Request Body

| Name                               | Type   | Description                                |
| ---------------------------------- | ------ | ------------------------------------------ |
| <mark style="color:red;">\*</mark> | Object | Object that contains wizard configuration. |

{% tabs %}
{% tab title="201: Created Successful Operation" %}

```
content:
            application/json:
              schema:
                type: object
                properties:
                  policyId:
                    type: string
                  wizardConfig:
                    $ref: "#/components/schemas/WizardConfig"
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized" %}

{% endtab %}

{% tab title="403: Forbidden Forbidden" %}

{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error" %}

```
content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
```

{% endtab %}
{% endtabs %}

## Creates a new policy. - Deprecated

<mark style="color:green;">`POST`</mark> `/policy/push`

Creates a new policy by wizard. Only users with the Standard Registry role are allowed to make the request.

#### Request Body

| Name                               | Type   | Description                                |
| ---------------------------------- | ------ | ------------------------------------------ |
| <mark style="color:red;">\*</mark> | Object | Object that contains wizard configuration. |

{% tabs %}
{% tab title="201: Created Successful Operation" %}

```
content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized" %}

{% endtab %}

{% tab title="403: Forbidden Forbidden" %}

{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error" %}

```
content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
```

{% endtab %}
{% endtabs %}

## Creates a new policy

<mark style="color:green;">`POST`</mark> `/wizard/push/policy`

Creates a new policy by wizard. Only users with the Standard Registry role are allowed to make the request.

#### Request Body

| Name                                                     | Type    | Description |
| -------------------------------------------------------- | ------- | ----------- |
| saveState<mark style="color:red;">\*</mark>              | Boolean |             |
| policy name<mark style="color:red;">\*</mark>            | String  |             |
| policy description<mark style="color:red;">\*</mark>     | String  |             |
| topicDescription<mark style="color:red;">\*</mark>       | String  |             |
| policyTag<mark style="color:red;">\*</mark>              | String  |             |
| schemas name<mark style="color:red;">\*</mark>           | String  |             |
| iri<mark style="color:red;">\*</mark>                    | String  |             |
| isApproveEnable<mark style="color:red;">\*</mark>        | Boolean |             |
| isMintSchema<mark style="color:red;">\*</mark>           | Boolean |             |
| mintOptions<mark style="color:red;">\*</mark>            | Object  |             |
| dependencySchemaIri<mark style="color:red;">\*</mark>    | String  |             |
| relationshipsSchemaIri<mark style="color:red;">\*</mark> | String  |             |
| initialRolesFor<mark style="color:red;">\*</mark>        | String  |             |
| role<mark style="color:red;">\*</mark>                   | String  |             |
| isApprover<mark style="color:red;">\*</mark>             | Boolean |             |
| isCreator<mark style="color:red;">\*</mark>              | Boolean |             |
| field<mark style="color:red;">\*</mark>                  | String  |             |
| title<mark style="color:red;">\*</mark>                  | String  |             |
| role<mark style="color:red;">\*</mark>                   | String  |             |
| mintSchemaIri<mark style="color:red;">\*</mark>          | String  |             |
| viewOnlyOwnDocuments<mark style="color:red;">\*</mark>   | Boolean |             |

{% tabs %}
{% tab title="200: OK Successful Operation" %}

```
          content:
            application/json:
              schema:
                type: boolean
```

{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error" %}

```
content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorDTO'
```

{% endtab %}
{% endtabs %}
