# Create policies

When you create a policy, you specify the following:

- Conditions of the policy, including standard and custom conditions.
- A workflow of steps.


## Prerequisite

Before you create your policy, you need the following:

| Prerequisite | Additional information |
|  --- | --- |
| The following new IDs, in a standard UUID format:A policy IDAn intent ID |  |


## Create a policy

System change process
All new requests to change the system state follow the same process. To familiarize yourself with this process first, follow the [Request a change with an intent](/products/custody/v1.15/resources/tutorials/intent) tutorial.

To create a new policy, follow the steps in [Request a change with an intent](/products/custody/v1.15/resources/tutorials/intent), with a payload similar to the following example.

### Payload example


```json
{
    "payload": {
        "id": "5b440ba5-d013-11eb-8cd0-dcfb48cfb3cb",
        "alias": "No approval for high trust score endpoint",
        "rank": 95,
        "intentTypes": [
          "v0_CreateTransactionOrder"
        ],
        "scope": "Self",
        "scriptingEngine": "Javascript_v0",
        "condition": {
            "expression": "context.references['endpoints'][context.request.payload.parameters.outputs.destination.endpointId].trustScore >= 90",
              "type": "Expression"
        },
        "workflow": null,
        "lock": "Unlocked",
        "description": "",
        "customProperties": {},
        "type": "v0_CreatePolicy"
   }
}
```

Fields of the `payload` block to note are as follows:

| Field | Description |
|  --- | --- |
| `type` | `v0_CreatePolicy` |
| `id` | You need to prepare this ID in a valid UUID format before you run this operation. |
| `lock` | You can set this to `Locked` to create an inactive policy and unlock it later. For more information, see [Update policies](/products/custody/v1.15/api/environment/policy/update). |
| `rank` | A value from 0 - 1000 to set the priority level of the policy |
| `intentTypes` | A list of strings to specify to which type of intent the policy can apply. Choose from the list available in [Perform a dry run for an intent](/products/custody/v1.15/api/reference/openapi/intents/createintent). A null value matches all intent types. |
| `scope` | Specifies the scope of application of the policy: `Self`: Applies only within the domain.`Descendants`: Applies only to the subdomains.`SelfAndDescendants`: Applies to both. |
| `scriptingVersion` | The version of the scripting engine. Currently, only `Javascript_v0` exists. |
| `condition` | The condition object, specified using JavaScript expressions. For more information, see [Conditions](/products/custody/v1.15/api/environment/policy/conditions). |
| `workflow` | A list of workflow objects. For more information, see [Workflows](/products/custody/v1.15/api/environment/policy/workflows). A null value always automatically approves, with no user approvals required. An empty array always automatically rejects the intent. |


The policy is created when the policy creation intent is successfully approved and executed.