Policies
Get a policy
Returns a single policy by its unique identifier.
GET
/
policies
/
{policyId}
cURL
curl --request GET \
--url https://api.onchainden.com/api/v1/policies/{policyId} \
--header 'Authorization: Bearer <token>'const client = new DenClient({ apiKey: 'ck_live_...' });
const policy = await client.getPolicy('pol_123');
{
"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"
}
}{
"error": {
"code": "notFound",
"message": "Resource not found"
}
}⌘I
cURL
curl --request GET \
--url https://api.onchainden.com/api/v1/policies/{policyId} \
--header 'Authorization: Bearer <token>'const client = new DenClient({ apiKey: 'ck_live_...' });
const policy = await client.getPolicy('pol_123');
{
"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"
}
}{
"error": {
"code": "notFound",
"message": "Resource not found"
}
}