Overview

You can delete a wallet whitelist if the wallet policy is in an unlocked state. Whitelist policies for self-custody wallets lock 48 hours after creation. If you need to delete a locked whitelist, request to unlock it by contacting support@bitgo.com.

Prerequisites

Cookbook

Need just the steps? Expand the cookbook below to get started:

Delete WhitelistsOpen Cookbook

1. Delete Whitelist

Endpoint: Delete Wallet-Policy Rule

export COIN="<ASSET_ID>"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export ID="<NAME_OF_WHITELIST>"

curl -X DELETE \
  "https://app.bitgo-test.com/api/v2/$COIN/wallet/$WALLET_ID/policy/rule" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
  "coin": "'"$COIN"'",
  "id": "'"$ID"'",
  "type": "advancedWhitelist",
  "condition": {
    "add": {
      "type": "address",
      "item": [
        "2N6CWMMYXdufJyBa16KNorHs8AakXcqyHhf",
        "2N4MTidamwHgzcgVnvWeSSW2s7jfszB7SNu"
      ]
    }
  },
  "action": {
    "type": "deny"
  }
}'

Step Result

If deleting the whitelist doesn't require approval, BitGo now removes it. However, the wallet policy still exists and triggers anytime a transaction initiates to a non-whitelisted address.

{
  "id": "66e9f4bb549f6c3957f8977fe3ed6ab4",
  "users": [
    {
      "user": "62ab90e06dfda30007974f0a52a12995",
      "permissions": ["admin", "spend", "view"]
    }
  ],
  "coin": "tbtc4",
  "label": "Policy Wallet 2",
  "m": 2,
  "n": 3,
  "keys": [
    "66e9f4ac6bfc0956265268311208afd7",
    "66e9f4ac9231837dc9c945a6c4a725d0",
    "66e9f4adbfe06bac12b54a93d22b6dfc"
  ],
  "keySignatures": {
    "backupPub": "3a8f2c7d1e9b4a6f0c5d8e3b2a7f1c4d9e6b3a0f7c2d5e8b1a4f9c6d3e0b7f2a5c8d1e4b9a6f3c0d7e2b5a8f1c4d9e6b3a0f7c2d5e8b1a4f9c6d3e0b7f2a5c8",
    "bitgoPub": "1c4f9b2e7a3d6c0f5b8a1e4c9f2b5a8d3e6a0c3f6b9d2e5a8c1f4b7a0d3e6c9f2b5d8a1e4c7f0b3d6a9e2c5f8b1d4a7e0c3f6b9d2e5a8c1f4b7a0d3e6c9f2b5d8"
  },
  "enterprise": "62c5ae8174ac860007aff138a2d74df7",
  "organization": "5b8c2d7e1f4a9b3c6d0e5f8a",
  "bitgoOrg": "BitGo Trust",
  "tags": [
    "66e9f4bb549f6c3957f8977fe3ed6ab4",
    "62c5ae8174ac860007aff138a2d74df7"
  ],
  "disableTransactionNotifications": false,
  "freeze": {
    "time": "2024-09-17T21:29:31.000Z",
    "expires": "2024-09-17T21:29:31.000Z",
    "reason": "UserRequest",
    "referenceId": "cmrq4n8bk0hj20ez9bfx3m7va",
    "adminOrUserId": "62ab90e06dfda30007974f0a"
  },
  "deleted": false,
  "approvalsRequired": 1,
  "isCold": false,
  "coinSpecific": {},
  "admin": {
    "policy": {
      "date": "2024-09-18T22:27:17.509Z",
      "id": "66e9f4bb549f6c3957f897824915d45f",
      "label": "default",
      "rules": [],
      "version": 7,
      "latest": true
    }
  },
  "clientFlags": [],
  "walletFlags": [],
  "allowBackupKeySigning": false,
  "startDate": "2024-09-17T21:29:31.000Z",
  "type": "hot",
  "buildDefaults": {},
  "customChangeKeySignatures": {},
  "hasLargeNumberOfAddresses": false,
  "multisigType": "onchain",
  "hasReceiveTransferPolicy": false,
  "creator": "62ab90e06dfda30007974f0a",
  "walletFullyCreated": true,
  "config": {}
}

2. Approve Whitelist (Optional)

Note: If deleting your wallet policy requires approval, another admin must approve it.

Endpoint: Update Pending Approval

export APPROVAL_ID="<APPROVAL_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export OTP="<YOUR_OTP>"

curl -X PUT \
  https://app.bitgo-test.com/api/v2/pendingApprovals/$APPROVAL_ID \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "state": "approved",
    "otp": "'"$OTP"'"
  }'

Step Result

The approval completes and BitGo now removes your wallet whitelist.

{
  "id": "66edb74b5c68723ded0cca89f2be239a",
  "coin": "tbtc4",
  "wallet": "66e9aba320e050e4334b23285bfe3b2e",
  "wallets": [],
  "enterprise": "62c5ae8174ac860007aff138a2d74df7",
  "bitgoOrg": "BitGo Trust",
  "creator": "62ab90e06dfda30007974f0a52a12995",
  "createDate": "2024-09-20T17:56:27.950Z",
  "approvedDate": "2024-09-20T17:58:47.976Z",
  "info": {
    "type": "policyRuleRequest",
    "policyRuleRequest": {
      "action": "remove",
      "update": {
        "id": "My First Wallet Policy for a Whitelist",
        "type": "advancedWhitelist",
        "action": { "type": "deny", "userIds": [] },
        "condition": {
          "add": {
            "type": "address",
            "item": [
              "2N6CWMMYXdufJyBa16KNorHs8AakXcqyHhf",
              "2N4MTidamwHgzcgVnvWeSSW2s7jfszB7SNu"
            ]
          }
        },
        "coin": "tbtc4"
      }
    }
  },
  "approvers": [],
  "state": "approved",
  "scope": "wallet",
  "userIds": [
    "62ab90e06dfda30007974f0a52a12995",
    "627ff9325a5c1b0007c05a40d15e1522"
  ],
  "approvalsRequired": 1,
  "singleRunResults": [],
  "resolvers": [
    {
      "user": "627ff9325a5c1b0007c05a40d15e1522",
      "date": "2024-09-20T17:58:47.898Z",
      "resolutionType": "pending",
      "resolutionAction": "approve"
    }
  ],
  "actions": [],
  "resolutionOrder": []
}

Next Steps

After deleting the whitelist, if you want to remove the wallet policy, see Deactivate Policy Rules.

See Also