pub struct WebhookSubscriptionRequest {
pub description: Option<Description>,
pub event_types: Vec<String>,
pub is_enabled: bool,
pub labels: HashMap<String, String>,
pub metadata: Option<Metadata>,
pub target: WebhookTarget,
}Expand description
Request to create a new webhook subscription with support for multi-label filtering.
JSON schema
{
"description": "Request to create a new webhook subscription with support for multi-label filtering.\n",
"type": "object",
"required": [
"eventTypes",
"isEnabled",
"target"
],
"properties": {
"description": {
"description": "Description of the webhook subscription.",
"examples": [
"Subscription for token transfer events"
],
"allOf": [
{
"$ref": "#/components/schemas/Description"
}
]
},
"eventTypes": {
"description": "Types of events to subscribe to. Event types follow a three-part dot-separated format:\nservice.resource.verb (e.g., \"onchain.activity.detected\", \"wallet.activity.detected\", \"onramp.transaction.created\").\nThe subscription will only receive events matching these types AND the label filter(s).\n",
"examples": [
[
"onchain.activity.detected"
]
],
"type": "array",
"items": {
"type": "string"
}
},
"isEnabled": {
"description": "Whether the subscription is enabled.",
"examples": [
true
],
"type": "boolean"
},
"labels": {
"description": "Optional. Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when\nan event contains ALL the key-value pairs specified here. Additional labels on\nthe event are allowed and will not prevent matching. Omit to receive all events for the selected event types.\n\n**Note:** Currently, labels are supported for onchain webhooks only.\n\nSee [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).\n",
"examples": [
{
"contract_address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"event_name": "Transfer",
"network": "base-mainnet"
}
],
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"metadata": {
"$ref": "#/components/schemas/Metadata"
},
"target": {
"$ref": "#/components/schemas/WebhookTarget"
}
}
}Fields§
§description: Option<Description>Description of the webhook subscription.
event_types: Vec<String>Types of events to subscribe to. Event types follow a three-part dot-separated format: service.resource.verb (e.g., “onchain.activity.detected”, “wallet.activity.detected”, “onramp.transaction.created”). The subscription will only receive events matching these types AND the label filter(s).
is_enabled: boolWhether the subscription is enabled.
labels: HashMap<String, String>Optional. Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when an event contains ALL the key-value pairs specified here. Additional labels on the event are allowed and will not prevent matching. Omit to receive all events for the selected event types.
**Note:** Currently, labels are supported for onchain webhooks only.
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).metadata: Option<Metadata>§target: WebhookTargetImplementations§
Source§impl WebhookSubscriptionRequest
impl WebhookSubscriptionRequest
pub fn builder() -> WebhookSubscriptionRequest
Trait Implementations§
Source§impl Clone for WebhookSubscriptionRequest
impl Clone for WebhookSubscriptionRequest
Source§fn clone(&self) -> WebhookSubscriptionRequest
fn clone(&self) -> WebhookSubscriptionRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more