POST
/v1/webhook_endpointsCreate a webhook endpoint
A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the webhooks settings section of the Dashboard.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
api_versionstringoptional
Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version.
connectbooleanoptional
Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). Defaults to `false`.
descriptionstringoptional
An optional description of what the webhook is used for.
enabled_eventsarray<string>required
The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection.
expandarray<string>optional
Specifies which fields in the response should be expanded.
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
urlstringrequired
The URL of the webhook endpoint.
200Successful response.
api_versionstringoptional
The API version events are rendered as for this webhook endpoint.
applicationstringoptional
The ID of the associated Connect application.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
descriptionstringoptional
An optional description of what the webhook is used for.
enabled_eventsarray<string>required
The list of events to enable for this endpoint. `['*']` indicates that all events are enabled, except those that require explicit selection.
idstringrequired
Unique identifier for the object.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectrequired
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
secretstringoptional
The endpoint's secret, used to generate [webhook signatures](https://docs.stripe.com/webhooks/signatures). Only returned at creation.
statusstringrequired
The status of the webhook. It can be `enabled` or `disabled`.
urlstringrequired
The URL of the webhook endpoint.
defaultError response.
errorobjectrequired
Error handling
Any other status is an error: Error response.