Create Policy

POST /v2/policies

A policy contains a rule against which an activity will be evaluated and a set of approval groups from which an approval will be required in case the rule is triggered. These are the supported activityKinds:

Required Permissions

NameConditions

Policies:Create

Always Required

Request body

Request body fieldsRequired/OptionalDescriptionType

name

Required

A name for the Policy.

String

activityKind

Required

Determines which actions on the API may trigger an Approval. See supported values above.

Enumerated Type

rule

Required

Conditions that will be evaluated for relevant activity.

Object

action

Required

The action that will be taken if a policy is triggered

Object

filters

Optional

Specify a list of entities to scope the policy to (eg. wallets).

Object

Rule Object (see rules)

Request body fieldsRequired/OptionalDescriptionType

kind

Required

The kind of rule that will be specified.

Enumerated Type

configuration

Required

Details specific to the rule kind.

Object

Action Object (see action)

Request body fieldsRequired/OptionalDescriptionType

kind

Required

RequestApproval or Blocked.

Enumerated Type

approvalGroups

Required / Optional

Quorum required for approval of activity.

Object

autoRejectTimeout

Required / Optional

Fine-grained approval group configuration.

Object

Filter Object (see filters)

Request body fieldsRequired/OptionalDescriptionType

id

Optional

Apply policy only to entities with specified ID.

Object

Request Example

{
  "name": "Transfer Limit",
  "activityKind": "Wallets:Sign",
  "rule": {
    "kind": "TransactionAmountLimit",
    "configuration": {
      "currency": "EUR",
      "limit": "1000"
    }
  },
  "action": {
    "kind": "RequestApproval",
    "approvalGroups": [
      {
        "name": "Admins",
        "quorum": 1,
        "approvers": {
          "userId": {
            "in": [
              "us-..."
            ]
          }
        }
      }
    ],
    "autoRejectTimeout": 60
  },
  "filters": {
    "id": {
      "in": [
        "wa-..."
      ]
    }
  }
}

Response

Response example

{
  "id": "plc-...",
  "name": "Transfer Limit",
  "rule": {
    "kind": "TransactionAmountLimit",
    "configuration": {
      "currency": "EUR",
      "limit": "1000"
    }
  },
  "status": "Active",
  "filters": {
    "id": {
      "in": [
        "wa-..."
      ]
    }
  },
  "activityKind": "Wallets:Sign",
  "action": {
    "kind": "RequestApproval",
    "approvalGroups": [
      {
        "name": "Admins",
        "quorum": 1,
        "approvers": {
          "userId": {
            "in": [
              "us-..."
            ]
          }
        }
      }
    ],
    "autoRejectTimeout": 60
  }
}

Last updated