Overview
Get started with Onchain Webhooks in just a few steps. This guide will help you create a webhook subscription via our REST endpoints and receive the events at a target destination.Prerequisites
1
Create 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
2
Install cdpcurl
Install
cdpcurl
to make authenticated requests to CDP APIs:3
Get a webhook URL
You’ll need an HTTPS URL to receive webhook events.
Tip: Setting up your URL
Tip: Setting up your URL
Easiest for testing: You can use webhook.site to get a free temporary URL instantly where you can view payloads and test with up to 100 events before rate limits apply.
1. Construct subscription payload
Create a JSON payload to be used withcdpcurl
in the next step:
subscription.json
Configuration fields
Field | Description | Required | Notes |
---|---|---|---|
target.url | Your webhook endpoint URL | Yes | Must be a valid HTTPS URL |
labels.contract_address | Smart contract address to monitor | Yes | Hex address with 0x prefix |
labels.event_name | Smart contract event name | Yes* (this OR event_signature ) | Event name from ABI (e.g., Transfer ) |
labels.event_signature | Smart contract event signature | Yes* (this OR event_name ) | Full signature (e.g., Transfer(address,address,uint256) ) |
eventTypes | Array of event types | No | Use ["onchain.activity.detected"] if provided |
isEnabled | Enable/disable webhook | No | Defaults to true |
target.headers | Custom HTTP headers | No | Object with header key-value pairs |
labels.params.[any_param] | Any smart contract parameter | No | Add any parameter from the contract event for hyper-granular filtering (e.g., params.from , params.to , params.value ) |
Custom headers
You can also set aheaders
object in target
if your URL requires specific headers:
custom-headers.json
2. Create subscription
Using the configuration you created in the previous step, create the webhook subscription usingcdpcurl
:
response.json
Additional endpoints
See the following examples to view, update, or delete the subscription using thesubscriptionId
from the response.
List all subscriptions
View subscription details
Update subscription
Delete subscription
What to read next
- Verify webhook signatures: Learn how to verify webhook signatures to ensure events are coming from Coinbase
- REST API Reference: View the complete webhook API documentation
- Support: Join our Discord for help and community support