Policies
Get all policies
Returns all policies for the organization (not paginated - returns full set).
GET
/
policies
cURL
curl --request GET \
--url https://api.onchainden.com/api/v1/policies \
--header 'Authorization: Bearer <token>'const client = new DenClient({ apiKey: 'ck_live_...' });
const { data: policies } = await client.getPolicies();
{
"data": [
{
"id": "pol_123",
"name": "Auto-approve Small Transfers",
"type": "AUTO_APPROVAL",
"transactionType": "TOKEN_TRANSFER",
"networkId": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "Auto-approve USDC transfers under $1000",
"accounts": [
{
"id": "acc_1",
"name": "Treasury",
"address": "<string>"
}
],
"limitation": {
"hours": 24,
"initiatorScope": "PER_ITEM",
"sourceAccountScope": "PER_ITEM",
"destinationScope": "PER_ITEM"
},
"initiatorSetting": {
"type": "user",
"userId": "usr_123"
},
"approverSetting": {
"type": "group"
},
"tokenTransferCondition": {
"tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"tokenSymbol": "USDC",
"tokenName": "USD Coin",
"tokenLogoUrl": "https://assets.onchainden.com/tokens/usdc.png",
"tokenDecimals": 6,
"amountThreshold": "1000000000",
"destinationAddresses": []
}
}
]
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}Authorizations
API key authentication. Include your API key in the Authorization header.
Response
List of policies
- Token Transfer
- Contract Interaction
- Any Transaction
Show child attributes
Show child attributes
⌘I
cURL
curl --request GET \
--url https://api.onchainden.com/api/v1/policies \
--header 'Authorization: Bearer <token>'const client = new DenClient({ apiKey: 'ck_live_...' });
const { data: policies } = await client.getPolicies();
{
"data": [
{
"id": "pol_123",
"name": "Auto-approve Small Transfers",
"type": "AUTO_APPROVAL",
"transactionType": "TOKEN_TRANSFER",
"networkId": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "Auto-approve USDC transfers under $1000",
"accounts": [
{
"id": "acc_1",
"name": "Treasury",
"address": "<string>"
}
],
"limitation": {
"hours": 24,
"initiatorScope": "PER_ITEM",
"sourceAccountScope": "PER_ITEM",
"destinationScope": "PER_ITEM"
},
"initiatorSetting": {
"type": "user",
"userId": "usr_123"
},
"approverSetting": {
"type": "group"
},
"tokenTransferCondition": {
"tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"tokenSymbol": "USDC",
"tokenName": "USD Coin",
"tokenLogoUrl": "https://assets.onchainden.com/tokens/usdc.png",
"tokenDecimals": 6,
"amountThreshold": "1000000000",
"destinationAddresses": []
}
}
]
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}