Overview
This guide shows how to use Onchain Data Webhooks from a Server Wallet workflow to create webhook subscriptions via our REST endpoints and receive events at your target destination.Enhanced webhooks for Server Wallets and Embedded Wallets are coming soon. Today, this guide uses Onchain Data webhooks with wallet address filters.
Prerequisites
Before setting up your webhook subscription, make sure you have the following:A CDP Server Wallet address
A CDP Server Wallet address
If you don’t already have one, follow the Server Wallet v2 Quickstart.After completing it, you should have:
CDP_API_KEY_IDCDP_API_KEY_SECRET- An EVM wallet address to use as
WALLET_ADDRESS
Funding is not required to create a webhook subscription. Funding is required only if you want to trigger and validate live transfer events.
A webhook URL
A webhook URL
You’ll need an HTTPS URL to receive webhook events.
- Go to webhook.site.
- Copy your unique HTTPS URL.
- Use that URL as
WEBHOOK_URLin Local environment variables configured.
cdpcurl
cdpcurl
Install
cdpcurl to make authenticated requests to CDP APIs:- Install with Homebrew or Go:
Local environment variables configured
Local environment variables configured
Set these once in your terminal so you can run the commands in this guide as-is.
This guide defaults to Base Sepolia for testnet validation.
USDC_CONTRACT_ADDRESS tells the webhook which token contract to watch. Without this filter, your subscription may match transfers from other tokens too. The value shown above is the USDC contract on Base Sepolia (testnet).1. Prepare subscription payload
In this example, you will track USDC transfers in or out of your CDP Server Wallet. Each subscription listens foronchain.activity.detected events on the USDC contract, filtered by your wallet address using the params.from and params.to labels.
- Outgoing transfers
- Incoming transfers
Run this to create
outgoing-usdc.json using your exported env vars:You can filter on any ERC-20 event parameter using
params.[any_param] in labels (e.g. params.from, params.to, params.value). See the configuration fields table in the Onchain Data Webhooks Quickstart for the full list of supported label filters.Alternative: monitor all wallet activity with wallet.activity.detected
Alternative: monitor all wallet activity with wallet.activity.detected
If you want to monitor all ERC-20 token transfer activity on your wallet address across any token (without specifying a contract), use Then create both subscriptions using the same
wallet.activity.detected instead. This is a simpler approach and is what CDP Portal uses by default.Use this when:- You want to track all ERC-20 tokens, not just USDC
- You don’t need contract-level filtering
- You prefer fewer labels and simpler setup
params.from and params.to cannot be combined in a single subscription.cdpcurl commands from step 2, replacing outgoing-usdc.json / incoming-usdc.json with outgoing-wallet.json / incoming-wallet.json.2. Subscribe to transfer events
Using the configurations you created in the previous step, create webhook subscriptions usingcdpcurl.
- Outgoing transfers
- Incoming transfers
response.json
3. Verify webhook event capture
Use the CDP Faucet to send 1 USDC to your wallet and confirm the webhook fires.Send USDC via CDP Faucet
Open the CDP Faucet, select Base Sepolia + USDC, paste your
WALLET_ADDRESS, and click Send.Check your webhook URL
Open your
WEBHOOK_URL and wait for an incoming POST request. You should receive an onchain.activity.detected payload similar to:Confirm the event matches your filter
Check that
parameters.to matches your WALLET_ADDRESS you exported in the prerequisites. This confirms your subscription to incoming transfer events is working successfully.To test outgoing, send USDC from your wallet and confirm parameters.from matches. See Transferring tokens from a CDP Wallet.