Update Policy

PUT /v2/policies/{policyId}

Updates a policy.

Required Permissions

NameConditions

Policies:Update

Always Required

Parameters

Path parameters

Path parameterDescription

policyId

Unique identifier of the policy

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/Optional

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": {
            "oneOf": [
              "us-..."
            ]
          }
        }
      }
    ],
    "autoRejectTimeout": 60
  },
  "filters": {
    "id": {
      "in": [
        "wa-..."
      ]
    }
  }
}

Response

Response example 200 - no approval required

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

Response example 202 - approval required

{
  "id": "cr-...",
  "orgId": "or-...",
  "requester": {
    "appId": "ap-...",
    "userId": "us-...",
    "tokenId": "to-..."
  },
  "kind": "Policy",
  "operationKind": "Update",
  "status": "Pending",
  "entityId": "plc-...",
  "body": {
    "id": "plc-...",
    "name": "Transfer Limit",
    "rule": {
      "kind": "TransactionAmountLimit",
      "configuration": {
        "currency": "EUR",
        "limit": "1000"
      }
    },
    "status": "Active",
    "filters": {
      "id": {
        "oneOf": [
          "wa-..."
        ]
      }
    },
    "activityKind": "Wallets:Sign",
    "action": {
      "kind": "RequestApproval",
      "approvalGroups": [
        {
          "name": "Admins",
          "quorum": 1,
          "approvers": {
            "userId": {
              "oneOf": [
                "us-..."
              ]
            }
          }
        }
      ],
      "autoRejectTimeout": 60
    }
  },
  "dateCreated": "2023-12-22T20:57:55.814Z",
  "dateResolved": "2023-12-22T20:57:55.814Z"
}

Last updated