Update an endpoint

Change a webhook endpoint's URL, events or description, or switch it off and on.

PATCH{BASE_URL}/webhooks/{id}

Changes only the fields you send. Requires a provider key; the partner header is ignored. Send null to clear description.

Path parameters

idstringrequired
The endpoint's ID.

Body — send at least one

urlstringoptional
A new URL, under the same rules as on create.
eventsstring[]optional
The full new list of events. It replaces the old list; it is not merged with it.
statusstringoptional
DISABLED to stop deliveries, or ENABLED to resume them. Enabling clears disabledAt and disabledReason and resets consecutiveFailures to 0.
descriptionstring | nulloptional
Up to 200 characters.

environment cannot be changed. Sending it answers 400 environment_immutable; create an endpoint in the other environment instead.

Response

dataobjectrequired
The updated webhook endpoint.

Status codes#

StatusCodeMeaning
200—Updated.
400—A field is invalid, or the body has no fields (No fields to update).
400environment_immutableThe body contains environment.
400invalid_events, event_not_subscribableevents is invalid, as on create.
400https_required, private_address, …The URL is refused. See Refused webhook URLs.
403provider_key_requiredA partner key made the call.
404webhook_endpoint_not_foundYou have no endpoint with that ID.
409webhook_endpoint_duplicateAnother of your endpoints in this environment has that URL.
curl -X PATCH "$LOCALOY_BASE_URL/webhooks/cm8wh00k0000000000000001" \
  -H "Authorization: Bearer $LOCALOY_PROVIDER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "ENABLED" }'
Response · 200
{
  "success": true,
  "message": "Webhook endpoint updated",
  "data": {
    "id": "cm8wh00k0000000000000001",
    "url": "https://hooks.example.com/localoy",
    "environment": "PRODUCTION",
    "status": "ENABLED",
    "disabledAt": null,
    "disabledReason": null,
    "consecutiveFailures": 0,
    "…": "…"
  }
}