POST
/event_subscriptionsCreate an event subscription
Creates an event subscription to receive webhook notifications at a URL you specify. Supply url and optionally select event categories, associate an OAuth connection, configure a shared secret, or set the subscription status. If you select a Real-Time Decision event category, include only one category.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Webhook subscription configuration, including the destination URL and optional event filters and signing secret.
oauth_connection_idstringoptional
If specified, this subscription will only receive webhooks for Events associated with the specified OAuth Connection.
selected_event_categoriesarray<object>optional
If specified, this subscription will only receive webhooks for Events with the specified `category`. If specifying a Real-Time Decision event category, only one Event Category can be specified for the Event Subscription.
shared_secretstringoptional
The key that will be used to sign webhooks. If no value is passed, a random string will be used as default.
statusstringoptional
The status of the event subscription. Defaults to `active` if not specified.
urlstringrequired
The URL you'd like us to send webhooks to.
200Returns the created event subscription, including its identifier, status, webhook URL, selected event categories, and associated OAuth connection identifier.
created_atstringrequired
The time the event subscription was created.
idstringrequired
The event subscription identifier.
idempotency_keystringrequired
The idempotency key you chose for this object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).
oauth_connection_idstringrequired
If specified, this subscription will only receive webhooks for Events associated with this OAuth Connection.
selected_event_categoriesarray<EventSubscriptionSelectedEventCategoriesElement>required
If specified, this subscription will only receive webhooks for Events with the specified `category`.
statusstringrequired
This indicates if we'll send notifications to this subscription.
typestringrequired
A constant representing the object's type. For this resource it will always be `event_subscription`.
urlstringrequired
The webhook url where we'll send notifications.
4XXReturned when the request has a client-side error.
5XXReturned when the request encounters a server-side error.
Error handling
url is required. status must be active or disabled, shared_secret must be between 1 and 100 characters, and oauth_connection_id must be between 1 and 200 characters when provided. Each item in selected_event_categories must include an accepted event_category; select only one category if it is a Real-Time Decision event.