Policy Editor V2

Update the draft with a new set of rules by policy types

Update the draft and return its validation for specific policy types.

⚠️ IMPORTANT SECURITY NOTICE:

The Fireblocks Policy is a critical security guardrail. Programmatically modifying your policy via the API introduces significant security risks. As an industry best practice, Fireblocks strongly recommends manual editing accompanied by strict human oversight and approval workflows for all policy changes. Programmatic updates should only be implemented by advanced users with comprehensive, multi-layer security controls in place.

put/policy/draft

Request

Headers

Idempotency-Keystring

A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours.

Request body

policyTypesPolicyType[] required

Example request

{
  "policyTypes": [
    "TRANSFER"
  ],
  "rules": [
    {
      "name": "High Value Transfer Policy",
      "id": "policy_rule_001",
      "policyEngineVersion": "v2",
      "type": "TRANSFER",
      "subType": "TRANSFER",
      "initiator": "*",
      "asset": {
        "assetTypes": [
          "FUNGIBLE",
          "NFT",
          "*"
        ],
        "operator": "INCLUDES"
      },
      "source": {
        "type": [
          "VAULT",
          "UNMANAGED"
        ],
        "subType": [
          {
            "type": "VAULT",
            "id": "account123",
            "subType": "INTERNAL",
            "address": "0x123..."
          }
        ],
        "ids": [
          {
            "type": "VAULT",
            "id": "account123",
            "subType": "INTERNAL",
            "address": "0x123..."
          }
        ],
        "tags": [
          {
            "id": "tag_001"
          }
        ],
        "operator": "INCLUDES",
        "matchFrom": "ACCOUNT"
      },
      "destination": {
        "type": [
          "EXTERNAL"
        ],
        "operator": "INCLUDES",
        "addressType": "WHITELISTED"
      },
      "account": {
        "type": [
          "VAULT"
        ],
        "subType": [
          {
            "type": "VAULT",
            "id": "account123",
            "subType": "INTERNAL",
            "address": "0x123..."
          }
        ],
        "ids": [
          {
            "type": "VAULT",
            "id": "account123",
            "subType": "INTERNAL",
            "address": "0x123..."
          }
        ],
        "tags": [
          {
            "id": "tag_001"
          }
        ],
        "operator": "INCLUDES",
        "matchFrom": "ACCOUNT"
      },
      "side": "BUY",
      "verdict": {
        "action": "ALLOW",
        "approvers": {
          "operator": "AND",
          "approvalGroups": [
            {
              "threshold": 2,
              "users": [
                "user1",
                "user2"
              ]
            }
          ]
        },
        "designatedSigners": {
          "type": "SINGLE",
          "users": [
            "user1",
            "user2"
          ],
          "groups": [
            "group1",
            "group2"
          ]
        }
      },
      "amountOverTime": {
        "range": {
          "min": "100",
          "max": "10000"
        },
        "currency": "USD",
        "timePeriod": {
          "seconds": "86400",
          "initiator": "PER_SINGLE_MATCH",
          "source": "PER_SINGLE_MATCH",
          "destination": "PER_SINGLE_MATCH"
        }
      },
      "amount": {
        "range": {
          "min": "100",
          "max": "10000"
        },
        "currency": "USD"
      },
      "externalDescriptor": "High value transfer policy for institutional clients",
      "method": "*",
      "programCall": {
        "allowedSolanaProgramCalls": "WHITELISTED"
      },
      "screeningMetadata": {
        "direction": "OUTBOUND",
        "provider": "CHAINALYSIS",
        "riskRating": "MEDIUM",
        "riskScore": "0.8",
        "exposureType": "DIRECT",
        "status": "COMPLETED",
        "sourceAddress": "0x123...",
        "destAddress": "0x456..."
      },
      "quoteAsset": {
        "assetTypes": [
          "FUNGIBLE",
          "NFT",
          "*"
        ],
        "operator": "INCLUDES"
      },
      "baseAsset": {
        "assetTypes": [
          "FUNGIBLE",
          "NFT",
          "*"
        ],
        "operator": "INCLUDES"
      },
      "quoteAmount": {
        "range": {
          "min": "100",
          "max": "10000"
        }
      },
      "baseAmount": {
        "range": {
          "min": "100",
          "max": "10000"
        }
      },
      "dAppAddress": {
        "globalWhitelisted": [
          "rabby.io",
          "jup.ag"
        ],
        "tenantWhitelisted": [
          "uniswap.com",
          "opensea.io"
        ],
        "urls": [
          "*"
        ],
        "operator": "INCLUDES"
      },
      "derivationPath": {
        "path": [
          44,
          0,
          0,
          0,
          0
        ],
        "partial": false
      },
      "index": 1
    }
  ]
}

Response

A draft validation response object

Example response

{
  "draftResponse": {
    "rules": [
      {
        "name": "High Value Transfer Policy",
        "id": "policy_rule_001",
        "policyEngineVersion": "v2",
        "type": "TRANSFER",
        "subType": "TRANSFER",
        "initiator": "*",
        "asset": {
          "assetTypes": [
            "FUNGIBLE",
            "NFT",
            "*"
          ],
          "operator": "INCLUDES"
        },
        "source": {
          "type": [
            "VAULT",
            "UNMANAGED"
          ],
          "subType": [
            {
              "type": "VAULT",
              "id": "account123",
              "subType": "INTERNAL",
              "address": "0x123..."
            }
          ],
          "ids": [
            {
              "type": "VAULT",
              "id": "account123",
              "subType": "INTERNAL",
              "address": "0x123..."
            }
          ],
          "tags": [
            {
              "id": "tag_001"
            }
          ],
          "operator": "INCLUDES",
          "matchFrom": "ACCOUNT"
        },
        "destination": {
          "type": [
            "EXTERNAL"
          ],
          "operator": "INCLUDES",
          "addressType": "WHITELISTED"
        },
        "account": {
          "type": [
            "VAULT"
          ],
          "subType": [
            {
              "type": "VAULT",
              "id": "account123",
              "subType": "INTERNAL",
              "address": "0x123..."
            }
          ],
          "ids": [
            {
              "type": "VAULT",
              "id": "account123",
              "subType": "INTERNAL",
              "address": "0x123..."
            }
          ],
          "tags": [
            {
              "id": "tag_001"
            }
          ],
          "operator": "INCLUDES",
          "matchFrom": "ACCOUNT"
        },
        "side": "BUY",
        "verdict": {
          "action": "ALLOW",
          "approvers": {
            "operator": "AND",
            "approvalGroups": [
              {
                "threshold": 2,
                "users": [
                  "user1",
                  "user2"
                ]
              }
            ]
          },
          "designatedSigners": {
            "type": "SINGLE",
            "users": [
              "user1",
              "user2"
            ],
            "groups": [
              "group1",
              "group2"
            ]
          }
        },
        "amountOverTime": {
          "range": {
            "min": "100",
            "max": "10000"
          },
          "currency": "USD",
          "timePeriod": {
            "seconds": "86400",
            "initiator": "PER_SINGLE_MATCH",
            "source": "PER_SINGLE_MATCH",
            "destination": "PER_SINGLE_MATCH"
          }
        },
        "amount": {
          "range": {
            "min": "100",
            "max": "10000"
          },
          "currency": "USD"
        },
        "externalDescriptor": "High value transfer policy for institutional clients",
        "method": "*",
        "programCall": {
          "allowedSolanaProgramCalls": "WHITELISTED"
        },
        "screeningMetadata": {
          "direction": "OUTBOUND",
          "provider": "CHAINALYSIS",
          "riskRating": "MEDIUM",
          "riskScore": "0.8",
          "exposureType": "DIRECT",
          "status": "COMPLETED",
          "sourceAddress": "0x123...",
          "destAddress": "0x456..."
        },
        "quoteAsset": {
          "assetTypes": [
            "FUNGIBLE",
            "NFT",
            "*"
          ],
          "operator": "INCLUDES"
        },
        "baseAsset": {
          "assetTypes": [
            "FUNGIBLE",
            "NFT",
            "*"
          ],
          "operator": "INCLUDES"
        },
        "quoteAmount": {
          "range": {
            "min": "100",
            "max": "10000"
          }
        },
        "baseAmount": {
          "range": {
            "min": "100",
            "max": "10000"
          }
        },
        "dAppAddress": {
          "globalWhitelisted": [
            "rabby.io",
            "jup.ag"
          ],
          "tenantWhitelisted": [
            "uniswap.com",
            "opensea.io"
          ],
          "urls": [
            "*"
          ],
          "operator": "INCLUDES"
        },
        "derivationPath": {
          "path": [
            44,
            0,
            0,
            0,
            0
          ],
          "partial": false
        },
        "index": 1
      }
    ],
    "metadata": {
      "TRANSFER": {
        "editedBy": "user123",
        "editedAt": "2024-01-15T10:30:00Z",
        "publishedBy": "user456",
        "publishedAt": "2024-01-15T11:00:00Z"
      }
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.