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.
const response: Promise<FireblocksResponse<DraftReviewAndValidationResponse>> = fireblocks.policyEditorV2.updateDraft(policyEditorV2ApiUpdateDraftRequest);CompletableFuture<ApiResponse<DraftReviewAndValidationResponse>> response = fireblocks.policyEditorV2().updateDraft(updateDraftRequest, idempotencyKey);response = fireblocks.policy_editor_v2.update_draft(update_draft_request, idempotency_key);curl --request PUT \
--url https://api.fireblocks.io/v1/policy/draft \
--header 'Content-Type: application/json' \
--data '
{
"policyTypes": [
"TRANSFER"
],
"rules": [
{
"name": "High Value Transfer Policy",
"id": "policy_rule_001",
"policyEngineVersion": "v2",
"type": "TRANSFER",
"initiator": "*",
"source": {
"operator": "INCLUDES",
"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"
}
],
"matchFrom": "ACCOUNT"
},
"verdict": {
"action": "ALLOW"
},
"subType": "TRANSFER",
"destination": {
"type": [
"EXTERNAL"
],
"operator": "INCLUDES",
"addressType": "WHITELISTED"
},
"side": "BUY",
"amount": {
"range": {
"min": "100",
"max": "10000"
},
"currency": "USD"
},
"externalDescriptor": "High value transfer policy for institutional clients",
"method": "*",
"isGlobalPolicy": false,
"screeningMetadata": {
"direction": "OUTBOUND",
"provider": "CHAINALYSIS",
"riskRating": "MEDIUM",
"riskScore": "0.8",
"exposureType": "DIRECT",
"category": [
"<string>"
],
"name": [
"<string>"
],
"categoryId": [
"<string>"
],
"status": "COMPLETED",
"sourceAddress": "0x123...",
"destAddress": "0x456..."
},
"quoteAmount": {
"range": {
"min": "100",
"max": "10000"
}
},
"baseAmount": {
"range": {
"min": "100",
"max": "10000"
}
},
"derivationPath": {
"path": [
44,
0,
0,
0,
0
],
"partial": false
},
"index": 1
}
]
}
'const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
policyTypes: ['TRANSFER'],
rules: [
{
name: 'High Value Transfer Policy',
id: 'policy_rule_001',
policyEngineVersion: 'v2',
type: 'TRANSFER',
initiator: '*',
source: {
operator: 'INCLUDES',
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'}],
matchFrom: 'ACCOUNT'
},
verdict: {action: 'ALLOW'},
subType: 'TRANSFER',
destination: {type: ['EXTERNAL'], operator: 'INCLUDES', addressType: 'WHITELISTED'},
side: 'BUY',
amount: {range: {min: '100', max: '10000'}, currency: 'USD'},
externalDescriptor: 'High value transfer policy for institutional clients',
method: '*',
isGlobalPolicy: false,
screeningMetadata: {
direction: 'OUTBOUND',
provider: 'CHAINALYSIS',
riskRating: 'MEDIUM',
riskScore: '0.8',
exposureType: 'DIRECT',
category: ['<string>'],
name: ['<string>'],
categoryId: ['<string>'],
status: 'COMPLETED',
sourceAddress: '0x123...',
destAddress: '0x456...'
},
quoteAmount: {range: {min: '100', max: '10000'}},
baseAmount: {range: {min: '100', max: '10000'}},
derivationPath: {path: [44, 0, 0, 0, 0], partial: false},
index: 1
}
]
})
};
fetch('https://api.fireblocks.io/v1/policy/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fireblocks.io/v1/policy/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'policyTypes' => [
'TRANSFER'
],
'rules' => [
[
'name' => 'High Value Transfer Policy',
'id' => 'policy_rule_001',
'policyEngineVersion' => 'v2',
'type' => 'TRANSFER',
'initiator' => '*',
'source' => [
'operator' => 'INCLUDES',
'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'
]
],
'matchFrom' => 'ACCOUNT'
],
'verdict' => [
'action' => 'ALLOW'
],
'subType' => 'TRANSFER',
'destination' => [
'type' => [
'EXTERNAL'
],
'operator' => 'INCLUDES',
'addressType' => 'WHITELISTED'
],
'side' => 'BUY',
'amount' => [
'range' => [
'min' => '100',
'max' => '10000'
],
'currency' => 'USD'
],
'externalDescriptor' => 'High value transfer policy for institutional clients',
'method' => '*',
'isGlobalPolicy' => false,
'screeningMetadata' => [
'direction' => 'OUTBOUND',
'provider' => 'CHAINALYSIS',
'riskRating' => 'MEDIUM',
'riskScore' => '0.8',
'exposureType' => 'DIRECT',
'category' => [
'<string>'
],
'name' => [
'<string>'
],
'categoryId' => [
'<string>'
],
'status' => 'COMPLETED',
'sourceAddress' => '0x123...',
'destAddress' => '0x456...'
],
'quoteAmount' => [
'range' => [
'min' => '100',
'max' => '10000'
]
],
'baseAmount' => [
'range' => [
'min' => '100',
'max' => '10000'
]
],
'derivationPath' => [
'path' => [
44,
0,
0,
0,
0
],
'partial' => false
],
'index' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fireblocks.io/v1/policy/draft"
payload := strings.NewReader("{\n \"policyTypes\": [\n \"TRANSFER\"\n ],\n \"rules\": [\n {\n \"name\": \"High Value Transfer Policy\",\n \"id\": \"policy_rule_001\",\n \"policyEngineVersion\": \"v2\",\n \"type\": \"TRANSFER\",\n \"initiator\": \"*\",\n \"source\": {\n \"operator\": \"INCLUDES\",\n \"type\": [\n \"VAULT\",\n \"UNMANAGED\"\n ],\n \"subType\": [\n {\n \"type\": \"VAULT\",\n \"id\": \"account123\",\n \"subType\": \"INTERNAL\",\n \"address\": \"0x123...\"\n }\n ],\n \"ids\": [\n {\n \"type\": \"VAULT\",\n \"id\": \"account123\",\n \"subType\": \"INTERNAL\",\n \"address\": \"0x123...\"\n }\n ],\n \"tags\": [\n {\n \"id\": \"tag_001\"\n }\n ],\n \"matchFrom\": \"ACCOUNT\"\n },\n \"verdict\": {\n \"action\": \"ALLOW\"\n },\n \"subType\": \"TRANSFER\",\n \"destination\": {\n \"type\": [\n \"EXTERNAL\"\n ],\n \"operator\": \"INCLUDES\",\n \"addressType\": \"WHITELISTED\"\n },\n \"side\": \"BUY\",\n \"amount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n },\n \"currency\": \"USD\"\n },\n \"externalDescriptor\": \"High value transfer policy for institutional clients\",\n \"method\": \"*\",\n \"isGlobalPolicy\": false,\n \"screeningMetadata\": {\n \"direction\": \"OUTBOUND\",\n \"provider\": \"CHAINALYSIS\",\n \"riskRating\": \"MEDIUM\",\n \"riskScore\": \"0.8\",\n \"exposureType\": \"DIRECT\",\n \"category\": [\n \"<string>\"\n ],\n \"name\": [\n \"<string>\"\n ],\n \"categoryId\": [\n \"<string>\"\n ],\n \"status\": \"COMPLETED\",\n \"sourceAddress\": \"0x123...\",\n \"destAddress\": \"0x456...\"\n },\n \"quoteAmount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n }\n },\n \"baseAmount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n }\n },\n \"derivationPath\": {\n \"path\": [\n 44,\n 0,\n 0,\n 0,\n 0\n ],\n \"partial\": false\n },\n \"index\": 1\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/policy/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"policyTypes\": [\n \"TRANSFER\"\n ],\n \"rules\": [\n {\n \"name\": \"High Value Transfer Policy\",\n \"id\": \"policy_rule_001\",\n \"policyEngineVersion\": \"v2\",\n \"type\": \"TRANSFER\",\n \"initiator\": \"*\",\n \"source\": {\n \"operator\": \"INCLUDES\",\n \"type\": [\n \"VAULT\",\n \"UNMANAGED\"\n ],\n \"subType\": [\n {\n \"type\": \"VAULT\",\n \"id\": \"account123\",\n \"subType\": \"INTERNAL\",\n \"address\": \"0x123...\"\n }\n ],\n \"ids\": [\n {\n \"type\": \"VAULT\",\n \"id\": \"account123\",\n \"subType\": \"INTERNAL\",\n \"address\": \"0x123...\"\n }\n ],\n \"tags\": [\n {\n \"id\": \"tag_001\"\n }\n ],\n \"matchFrom\": \"ACCOUNT\"\n },\n \"verdict\": {\n \"action\": \"ALLOW\"\n },\n \"subType\": \"TRANSFER\",\n \"destination\": {\n \"type\": [\n \"EXTERNAL\"\n ],\n \"operator\": \"INCLUDES\",\n \"addressType\": \"WHITELISTED\"\n },\n \"side\": \"BUY\",\n \"amount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n },\n \"currency\": \"USD\"\n },\n \"externalDescriptor\": \"High value transfer policy for institutional clients\",\n \"method\": \"*\",\n \"isGlobalPolicy\": false,\n \"screeningMetadata\": {\n \"direction\": \"OUTBOUND\",\n \"provider\": \"CHAINALYSIS\",\n \"riskRating\": \"MEDIUM\",\n \"riskScore\": \"0.8\",\n \"exposureType\": \"DIRECT\",\n \"category\": [\n \"<string>\"\n ],\n \"name\": [\n \"<string>\"\n ],\n \"categoryId\": [\n \"<string>\"\n ],\n \"status\": \"COMPLETED\",\n \"sourceAddress\": \"0x123...\",\n \"destAddress\": \"0x456...\"\n },\n \"quoteAmount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n }\n },\n \"baseAmount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n }\n },\n \"derivationPath\": {\n \"path\": [\n 44,\n 0,\n 0,\n 0,\n 0\n ],\n \"partial\": false\n },\n \"index\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"draftResponse": {
"status": "<string>",
"rules": [
{
"name": "High Value Transfer Policy",
"id": "policy_rule_001",
"policyEngineVersion": "v2",
"type": "TRANSFER",
"initiator": "*",
"source": {
"operator": "INCLUDES",
"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"
}
],
"matchFrom": "ACCOUNT"
},
"verdict": {
"action": "ALLOW",
"approvers": {
"canInitiatorApprove": false,
"operator": "AND",
"allowOperatorAsAuthorizer": false,
"approvalGroups": [
{
"threshold": 2,
"users": [
"user1",
"user2"
]
}
]
},
"designatedSigners": {
"type": "SINGLE",
"users": [
"user1",
"user2"
],
"groups": [
"group1",
"group2"
]
}
},
"subType": "TRANSFER",
"asset": {
"nftTransfer": false,
"assetTypes": [
"FUNGIBLE",
"NFT",
"*"
],
"operator": "INCLUDES"
},
"destination": {
"type": [
"EXTERNAL"
],
"operator": "INCLUDES",
"addressType": "WHITELISTED"
},
"account": {
"operator": "INCLUDES",
"type": [
"VAULT"
],
"subType": [
{
"type": "VAULT",
"id": "account123",
"subType": "INTERNAL",
"address": "0x123..."
}
],
"ids": [
{
"type": "VAULT",
"id": "account123",
"subType": "INTERNAL",
"address": "0x123..."
}
],
"tags": [
{
"id": "tag_001"
}
],
"matchFrom": "ACCOUNT"
},
"side": "BUY",
"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": "*",
"isGlobalPolicy": false,
"programCall": {
"allowedSolanaProgramCalls": "WHITELISTED"
},
"screeningMetadata": {
"direction": "OUTBOUND",
"provider": "CHAINALYSIS",
"riskRating": "MEDIUM",
"riskScore": "0.8",
"exposureType": "DIRECT",
"category": [
"<string>"
],
"name": [
"<string>"
],
"categoryId": [
"<string>"
],
"status": "COMPLETED",
"sourceAddress": "0x123...",
"destAddress": "0x456..."
},
"quoteAsset": {
"nftTransfer": false,
"assetTypes": [
"FUNGIBLE",
"NFT",
"*"
],
"operator": "INCLUDES"
},
"baseAsset": {
"nftTransfer": false,
"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
}
],
"draftId": "<string>",
"metadata": {
"TRANSFER": {
"editedBy": "user123",
"editedAt": "2024-01-15T10:30:00Z",
"publishedBy": "user456",
"publishedAt": "2024-01-15T11:00:00Z"
}
}
},
"validation": {
"status": "<string>",
"checkResult": {
"errors": 123,
"results": [
{
"index": 123,
"errors": [
{
"errorMessage": "<string>",
"errorCode": 123,
"errorCodeName": "<string>"
}
]
}
]
}
}
}{
"message": "<string>",
"code": 123
}Headers
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.
Body
Request schema for updating draft with policy types and rules
Policy type enumeration
TRANSFER, STAKE, CONTRACT_CALL, TYPED_MESSAGE, APPROVE, MINT, BURN, RAW, COMPLIANCE, DEPLOYMENT, PROGRAM_CALL, DAPP_CONNECTION, UPGRADE, ORDER, AML_CHAINALYSIS_V2_SCREENING, AML_CHAINALYSIS_V2_POST_SCREENING, AML_ELLIPTIC_HOLISTIC_SCREENING, AML_ELLIPTIC_HOLISTIC_POST_SCREENING, TR_NOTABENE_SCREENING, TR_NOTABENE_POST_SCREENING Array of policy rules
Show child attributes
Show child attributes
Was this page helpful?
const response: Promise<FireblocksResponse<DraftReviewAndValidationResponse>> = fireblocks.policyEditorV2.updateDraft(policyEditorV2ApiUpdateDraftRequest);CompletableFuture<ApiResponse<DraftReviewAndValidationResponse>> response = fireblocks.policyEditorV2().updateDraft(updateDraftRequest, idempotencyKey);response = fireblocks.policy_editor_v2.update_draft(update_draft_request, idempotency_key);curl --request PUT \
--url https://api.fireblocks.io/v1/policy/draft \
--header 'Content-Type: application/json' \
--data '
{
"policyTypes": [
"TRANSFER"
],
"rules": [
{
"name": "High Value Transfer Policy",
"id": "policy_rule_001",
"policyEngineVersion": "v2",
"type": "TRANSFER",
"initiator": "*",
"source": {
"operator": "INCLUDES",
"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"
}
],
"matchFrom": "ACCOUNT"
},
"verdict": {
"action": "ALLOW"
},
"subType": "TRANSFER",
"destination": {
"type": [
"EXTERNAL"
],
"operator": "INCLUDES",
"addressType": "WHITELISTED"
},
"side": "BUY",
"amount": {
"range": {
"min": "100",
"max": "10000"
},
"currency": "USD"
},
"externalDescriptor": "High value transfer policy for institutional clients",
"method": "*",
"isGlobalPolicy": false,
"screeningMetadata": {
"direction": "OUTBOUND",
"provider": "CHAINALYSIS",
"riskRating": "MEDIUM",
"riskScore": "0.8",
"exposureType": "DIRECT",
"category": [
"<string>"
],
"name": [
"<string>"
],
"categoryId": [
"<string>"
],
"status": "COMPLETED",
"sourceAddress": "0x123...",
"destAddress": "0x456..."
},
"quoteAmount": {
"range": {
"min": "100",
"max": "10000"
}
},
"baseAmount": {
"range": {
"min": "100",
"max": "10000"
}
},
"derivationPath": {
"path": [
44,
0,
0,
0,
0
],
"partial": false
},
"index": 1
}
]
}
'const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
policyTypes: ['TRANSFER'],
rules: [
{
name: 'High Value Transfer Policy',
id: 'policy_rule_001',
policyEngineVersion: 'v2',
type: 'TRANSFER',
initiator: '*',
source: {
operator: 'INCLUDES',
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'}],
matchFrom: 'ACCOUNT'
},
verdict: {action: 'ALLOW'},
subType: 'TRANSFER',
destination: {type: ['EXTERNAL'], operator: 'INCLUDES', addressType: 'WHITELISTED'},
side: 'BUY',
amount: {range: {min: '100', max: '10000'}, currency: 'USD'},
externalDescriptor: 'High value transfer policy for institutional clients',
method: '*',
isGlobalPolicy: false,
screeningMetadata: {
direction: 'OUTBOUND',
provider: 'CHAINALYSIS',
riskRating: 'MEDIUM',
riskScore: '0.8',
exposureType: 'DIRECT',
category: ['<string>'],
name: ['<string>'],
categoryId: ['<string>'],
status: 'COMPLETED',
sourceAddress: '0x123...',
destAddress: '0x456...'
},
quoteAmount: {range: {min: '100', max: '10000'}},
baseAmount: {range: {min: '100', max: '10000'}},
derivationPath: {path: [44, 0, 0, 0, 0], partial: false},
index: 1
}
]
})
};
fetch('https://api.fireblocks.io/v1/policy/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fireblocks.io/v1/policy/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'policyTypes' => [
'TRANSFER'
],
'rules' => [
[
'name' => 'High Value Transfer Policy',
'id' => 'policy_rule_001',
'policyEngineVersion' => 'v2',
'type' => 'TRANSFER',
'initiator' => '*',
'source' => [
'operator' => 'INCLUDES',
'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'
]
],
'matchFrom' => 'ACCOUNT'
],
'verdict' => [
'action' => 'ALLOW'
],
'subType' => 'TRANSFER',
'destination' => [
'type' => [
'EXTERNAL'
],
'operator' => 'INCLUDES',
'addressType' => 'WHITELISTED'
],
'side' => 'BUY',
'amount' => [
'range' => [
'min' => '100',
'max' => '10000'
],
'currency' => 'USD'
],
'externalDescriptor' => 'High value transfer policy for institutional clients',
'method' => '*',
'isGlobalPolicy' => false,
'screeningMetadata' => [
'direction' => 'OUTBOUND',
'provider' => 'CHAINALYSIS',
'riskRating' => 'MEDIUM',
'riskScore' => '0.8',
'exposureType' => 'DIRECT',
'category' => [
'<string>'
],
'name' => [
'<string>'
],
'categoryId' => [
'<string>'
],
'status' => 'COMPLETED',
'sourceAddress' => '0x123...',
'destAddress' => '0x456...'
],
'quoteAmount' => [
'range' => [
'min' => '100',
'max' => '10000'
]
],
'baseAmount' => [
'range' => [
'min' => '100',
'max' => '10000'
]
],
'derivationPath' => [
'path' => [
44,
0,
0,
0,
0
],
'partial' => false
],
'index' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fireblocks.io/v1/policy/draft"
payload := strings.NewReader("{\n \"policyTypes\": [\n \"TRANSFER\"\n ],\n \"rules\": [\n {\n \"name\": \"High Value Transfer Policy\",\n \"id\": \"policy_rule_001\",\n \"policyEngineVersion\": \"v2\",\n \"type\": \"TRANSFER\",\n \"initiator\": \"*\",\n \"source\": {\n \"operator\": \"INCLUDES\",\n \"type\": [\n \"VAULT\",\n \"UNMANAGED\"\n ],\n \"subType\": [\n {\n \"type\": \"VAULT\",\n \"id\": \"account123\",\n \"subType\": \"INTERNAL\",\n \"address\": \"0x123...\"\n }\n ],\n \"ids\": [\n {\n \"type\": \"VAULT\",\n \"id\": \"account123\",\n \"subType\": \"INTERNAL\",\n \"address\": \"0x123...\"\n }\n ],\n \"tags\": [\n {\n \"id\": \"tag_001\"\n }\n ],\n \"matchFrom\": \"ACCOUNT\"\n },\n \"verdict\": {\n \"action\": \"ALLOW\"\n },\n \"subType\": \"TRANSFER\",\n \"destination\": {\n \"type\": [\n \"EXTERNAL\"\n ],\n \"operator\": \"INCLUDES\",\n \"addressType\": \"WHITELISTED\"\n },\n \"side\": \"BUY\",\n \"amount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n },\n \"currency\": \"USD\"\n },\n \"externalDescriptor\": \"High value transfer policy for institutional clients\",\n \"method\": \"*\",\n \"isGlobalPolicy\": false,\n \"screeningMetadata\": {\n \"direction\": \"OUTBOUND\",\n \"provider\": \"CHAINALYSIS\",\n \"riskRating\": \"MEDIUM\",\n \"riskScore\": \"0.8\",\n \"exposureType\": \"DIRECT\",\n \"category\": [\n \"<string>\"\n ],\n \"name\": [\n \"<string>\"\n ],\n \"categoryId\": [\n \"<string>\"\n ],\n \"status\": \"COMPLETED\",\n \"sourceAddress\": \"0x123...\",\n \"destAddress\": \"0x456...\"\n },\n \"quoteAmount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n }\n },\n \"baseAmount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n }\n },\n \"derivationPath\": {\n \"path\": [\n 44,\n 0,\n 0,\n 0,\n 0\n ],\n \"partial\": false\n },\n \"index\": 1\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/policy/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"policyTypes\": [\n \"TRANSFER\"\n ],\n \"rules\": [\n {\n \"name\": \"High Value Transfer Policy\",\n \"id\": \"policy_rule_001\",\n \"policyEngineVersion\": \"v2\",\n \"type\": \"TRANSFER\",\n \"initiator\": \"*\",\n \"source\": {\n \"operator\": \"INCLUDES\",\n \"type\": [\n \"VAULT\",\n \"UNMANAGED\"\n ],\n \"subType\": [\n {\n \"type\": \"VAULT\",\n \"id\": \"account123\",\n \"subType\": \"INTERNAL\",\n \"address\": \"0x123...\"\n }\n ],\n \"ids\": [\n {\n \"type\": \"VAULT\",\n \"id\": \"account123\",\n \"subType\": \"INTERNAL\",\n \"address\": \"0x123...\"\n }\n ],\n \"tags\": [\n {\n \"id\": \"tag_001\"\n }\n ],\n \"matchFrom\": \"ACCOUNT\"\n },\n \"verdict\": {\n \"action\": \"ALLOW\"\n },\n \"subType\": \"TRANSFER\",\n \"destination\": {\n \"type\": [\n \"EXTERNAL\"\n ],\n \"operator\": \"INCLUDES\",\n \"addressType\": \"WHITELISTED\"\n },\n \"side\": \"BUY\",\n \"amount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n },\n \"currency\": \"USD\"\n },\n \"externalDescriptor\": \"High value transfer policy for institutional clients\",\n \"method\": \"*\",\n \"isGlobalPolicy\": false,\n \"screeningMetadata\": {\n \"direction\": \"OUTBOUND\",\n \"provider\": \"CHAINALYSIS\",\n \"riskRating\": \"MEDIUM\",\n \"riskScore\": \"0.8\",\n \"exposureType\": \"DIRECT\",\n \"category\": [\n \"<string>\"\n ],\n \"name\": [\n \"<string>\"\n ],\n \"categoryId\": [\n \"<string>\"\n ],\n \"status\": \"COMPLETED\",\n \"sourceAddress\": \"0x123...\",\n \"destAddress\": \"0x456...\"\n },\n \"quoteAmount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n }\n },\n \"baseAmount\": {\n \"range\": {\n \"min\": \"100\",\n \"max\": \"10000\"\n }\n },\n \"derivationPath\": {\n \"path\": [\n 44,\n 0,\n 0,\n 0,\n 0\n ],\n \"partial\": false\n },\n \"index\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"draftResponse": {
"status": "<string>",
"rules": [
{
"name": "High Value Transfer Policy",
"id": "policy_rule_001",
"policyEngineVersion": "v2",
"type": "TRANSFER",
"initiator": "*",
"source": {
"operator": "INCLUDES",
"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"
}
],
"matchFrom": "ACCOUNT"
},
"verdict": {
"action": "ALLOW",
"approvers": {
"canInitiatorApprove": false,
"operator": "AND",
"allowOperatorAsAuthorizer": false,
"approvalGroups": [
{
"threshold": 2,
"users": [
"user1",
"user2"
]
}
]
},
"designatedSigners": {
"type": "SINGLE",
"users": [
"user1",
"user2"
],
"groups": [
"group1",
"group2"
]
}
},
"subType": "TRANSFER",
"asset": {
"nftTransfer": false,
"assetTypes": [
"FUNGIBLE",
"NFT",
"*"
],
"operator": "INCLUDES"
},
"destination": {
"type": [
"EXTERNAL"
],
"operator": "INCLUDES",
"addressType": "WHITELISTED"
},
"account": {
"operator": "INCLUDES",
"type": [
"VAULT"
],
"subType": [
{
"type": "VAULT",
"id": "account123",
"subType": "INTERNAL",
"address": "0x123..."
}
],
"ids": [
{
"type": "VAULT",
"id": "account123",
"subType": "INTERNAL",
"address": "0x123..."
}
],
"tags": [
{
"id": "tag_001"
}
],
"matchFrom": "ACCOUNT"
},
"side": "BUY",
"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": "*",
"isGlobalPolicy": false,
"programCall": {
"allowedSolanaProgramCalls": "WHITELISTED"
},
"screeningMetadata": {
"direction": "OUTBOUND",
"provider": "CHAINALYSIS",
"riskRating": "MEDIUM",
"riskScore": "0.8",
"exposureType": "DIRECT",
"category": [
"<string>"
],
"name": [
"<string>"
],
"categoryId": [
"<string>"
],
"status": "COMPLETED",
"sourceAddress": "0x123...",
"destAddress": "0x456..."
},
"quoteAsset": {
"nftTransfer": false,
"assetTypes": [
"FUNGIBLE",
"NFT",
"*"
],
"operator": "INCLUDES"
},
"baseAsset": {
"nftTransfer": false,
"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
}
],
"draftId": "<string>",
"metadata": {
"TRANSFER": {
"editedBy": "user123",
"editedAt": "2024-01-15T10:30:00Z",
"publishedBy": "user456",
"publishedAt": "2024-01-15T11:00:00Z"
}
}
},
"validation": {
"status": "<string>",
"checkResult": {
"errors": 123,
"results": [
{
"index": 123,
"errors": [
{
"errorMessage": "<string>",
"errorCode": 123,
"errorCodeName": "<string>"
}
]
}
]
}
}
}{
"message": "<string>",
"code": 123
}