Skip to main content
POST
/
v1
/
policy-engine
/
policies
Create Policy
curl --request POST \
  --url https://api.example.com/v1/policy-engine/policies \
  --header 'Content-Type: application/json' \
  --data '
{
  "tenantId": "<string>",
  "projectId": "<string>",
  "name": "<string>",
  "description": "<string>",
  "rule": {
    "addressWhitelist": {
      "enabled": true,
      "allowedAddresses": [
        {}
      ],
      "denyAll": true
    },
    "amountLimit": {
      "enabled": true,
      "dailyLimit": "<string>",
      "perTxLimit": "<string>",
      "currency": "<string>"
    },
    "approvalFlow": {
      "enabled": true,
      "threshold": "<string>",
      "approvers": [
        {}
      ],
      "requiredApprovals": 123
    }
  },
  "priority": 123,
  "enabled": true
}
'
{
  "policy": {}
}

Create Policy

Create a policy rule to control transaction behavior. Policies can enforce address whitelists, amount limits, and approval workflows.

Request

tenantId
string
required
Tenant identifier
projectId
string
required
Project identifier
name
string
required
Policy name
description
string
Policy description
rule
object
required
Policy rule configuration
priority
integer
Policy priority (higher = evaluated first)
enabled
boolean
Whether policy is active

Response

policy
object
Created policy object

Example

curl -X POST https://api.axonvault.io/v1/policy-engine/policies \
  -H "X-Access-Key: ak_live_abc123" \
  -H "X-Signature: 5d41402abc4b2a76b9719d911017c592" \
  -H "X-Timestamp: 2024-01-15T10:30:00Z" \
  -H "Content-Type: application/json" \
  -d '{
    "tenantId": "ten_abc123",
    "projectId": "proj_abc123",
    "name": "High Value Approval",
    "description": "Require approval for transactions over $10,000",
    "rule": {
      "approvalFlow": {
        "enabled": true,
        "threshold": "10000",
        "approvers": ["usr_admin1", "usr_admin2"],
        "requiredApprovals": 1
      }
    },
    "priority": 100,
    "enabled": true
  }'

Response Example

{
  "policy": {
    "policyId": "pol_abc123",
    "tenantId": "ten_abc123",
    "projectId": "proj_abc123",
    "name": "High Value Approval",
    "description": "Require approval for transactions over $10,000",
    "rule": {
      "approvalFlow": {
        "enabled": true,
        "threshold": "10000",
        "approvers": ["usr_admin1", "usr_admin2"],
        "requiredApprovals": 1
      }
    },
    "priority": 100,
    "enabled": true,
    "createAt": "2024-01-15T10:30:00Z",
    "updateAt": "2024-01-15T10:30:00Z"
  }
}

Policy Types

Address Whitelist

Only allow transactions to specific addresses:
{
  "rule": {
    "addressWhitelist": {
      "enabled": true,
      "allowedAddresses": [
        "0x1234567890123456789012345678901234567890",
        "0xabcdef1234567890abcdef1234567890abcdef12"
      ],
      "denyAll": true
    }
  }
}

Amount Limits

Set daily and per-transaction limits:
{
  "rule": {
    "amountLimit": {
      "enabled": true,
      "dailyLimit": "100000",
      "perTxLimit": "10000",
      "currency": "USD"
    }
  }
}

Approval Flow

Require human approval for high-value transactions:
{
  "rule": {
    "approvalFlow": {
      "enabled": true,
      "threshold": "50000",
      "approvers": ["usr_cfo", "usr_ceo"],
      "requiredApprovals": 2
    }
  }
}

Errors

Error TypeStatusDescription
invalid_request400Invalid rule configuration
already_exists409Policy name already exists