Skip to content

Update a webhook endpoint

POST
/v1/webhook_endpoints/{id}
curl --request POST \
--url https://api.example.com/v1/webhook_endpoints/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "url": "https://example.com", "enabled_events": [ "example" ], "status": "enabled" }'

Changes where the endpoint is, which events it is sent, or whether it is sent anything: set status to enabled to turn a disabled endpoint back on. Leave out what stays. Deliveries that failed while it was disabled stay failed.

id
required
string

The object’s id.

Media typeapplication/json
object
url
string format: uri
enabled_events

The types to send, or ["*"] for every type, including those added later.

Array<string>
status
string
Allowed values: enabled disabled

The endpoint.

Media typeapplication/json
object
id
string
object
string
Allowed value: webhook_endpoint
url
string format: uri
enabled_events
Array<string>
status
string
Allowed values: enabled disabled
secret

The signing secret, whsec_.... Returned on create and rotate only.

string
livemode
boolean
created

A Unix timestamp.

integer
Example
{
"id": "we_3f9a1c2b7d4e5f60718293a4",
"object": "webhook_endpoint",
"status": "enabled"
}

authentication_failure: access_token_required when no token was sent, invalid_access_token when it is not valid, has expired, or is a client secret. Sent with a WWW-Authenticate: Bearer header, which adds error="invalid_token" when a token was sent.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: validation_failure authentication_failure authorization_failure not_found conflict timeout_or_in_progress policy_rejection invariant_violation rate_limited dependency_failure
code
required

A stable name for this refusal. Branch on this, never on message.

string
message
required

For the developer reading a log. May be reworded.

string
param
required

The field or parameter at fault, when there is one.

string | null
request_id
required
string | null
Example
{
"error": {
"type": "validation_failure"
}
}

authorization_failure with merchant_mismatch: a Merchant-Id header, query parameter or body field names a merchant or tenant other than the key’s.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: validation_failure authentication_failure authorization_failure not_found conflict timeout_or_in_progress policy_rejection invariant_violation rate_limited dependency_failure
code
required

A stable name for this refusal. Branch on this, never on message.

string
message
required

For the developer reading a log. May be reworded.

string
param
required

The field or parameter at fault, when there is one.

string | null
request_id
required
string | null
Example
{
"error": {
"type": "validation_failure"
}
}

not_found: resource_missing for an id this key cannot see, route_missing for a path that does not exist.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: validation_failure authentication_failure authorization_failure not_found conflict timeout_or_in_progress policy_rejection invariant_violation rate_limited dependency_failure
code
required

A stable name for this refusal. Branch on this, never on message.

string
message
required

For the developer reading a log. May be reworded.

string
param
required

The field or parameter at fault, when there is one.

string | null
request_id
required
string | null
Example
{
"error": {
"type": "validation_failure"
}
}

dependency_failure with service_unavailable: something on our side did not answer, or failed part-way. Whether the change was made is not known. This call takes no Idempotency-Key and needs none: send the same request again, and the endpoint ends up as the first call would have left it, however many times it is sent. Read the endpoint to see how it stands.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: validation_failure authentication_failure authorization_failure not_found conflict timeout_or_in_progress policy_rejection invariant_violation rate_limited dependency_failure
code
required

A stable name for this refusal. Branch on this, never on message.

string
message
required

For the developer reading a log. May be reworded.

string
param
required

The field or parameter at fault, when there is one.

string | null
request_id
required
string | null
Example
{
"error": {
"type": "validation_failure"
}
}