Create a notification subscription by configuring an endpoint to receive notifications. For details, see the Notification Flows guide.
Required parameters to create a new subscription.
URL of the endpoint to subscribe to notifications. Must be publicly accessible, use HTTPS, and respond with a 2XX status to a POST request.
The notification types to subscribe to. If not provided, the webhook will be unrestricted, and a notification is sent for every notification type. If the wildcard (*
) or any combination of the wildcard and a set of notification types is provided, the webhook will also be unrestricted. If a set of notification types are provided, the webhook will be restricted. The restricted status of the webhook is returned in the response object. Each category of notification types also has a wildcard, which will restrict to all notification types from that category.
Developer-provided parameter used to identify this request. Useful when communicating with Circle Support.
1from circle.web3 import configurations
2from circle.web3 import utils
3
4client = utils.init_configurations_client(api_key=key)
5
6api_instance = utils.configurations.WebhookSubscriptionsApi(client)
7request = configurations.CreateSubscriptionRequest.from_dict({
8 "endpoint": "https://example.com/webhook",
9 "notification_types": ["transactions.inbound"]
10})
11response = api_instance.create_subscription(create_subscription_request=request)
12print(response.json())
13
1{
2 "data": {
3 "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
4 "name": "Transactions Webhook",
5 "endpoint": "https://example.org/handler/for/notifications",
6 "enabled": true,
7 "create_date": "2023-01-01T12:04:05Z",
8 "update_date": "2023-01-01T12:04:05Z",
9 "notification_types": [
10 "*"
11 ],
12 "restricted": false
13 }
14}