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 Secret API Key
A Secret API Key
Sign up at portal.cdp.coinbase.com, then navigate to API Keys and select Create API key under the Secret API Keys tab.
- Enter an API key nickname (restrictions are optional)
- Click Create
- Secure your API Key ID and Secret in a safe location
A webhook URL
A webhook URL
You’ll need an HTTPS URL to receive webhook events. For quick testing, webhook.site gives free temporary URLs instantly.For production, use your own HTTPS endpoint.
cdpcurl
cdpcurl
Install
cdpcurl to make authenticated requests to CDP APIs: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 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.
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
Use this when:Then create both subscriptions using the same
- 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
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.What to read next
Create webhook subscription
Full reference for supported event types, label filters (
params.*, transaction_from, transaction_to), and advanced optionsOnchain Data Webhooks Overview
Learn more about webhook capabilities, delivery guarantees, and supported use cases