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.
statusstringoptionalDISABLEDto stop deliveries, orENABLEDto resume them. Enabling clearsdisabledAtanddisabledReasonand resetsconsecutiveFailuresto 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#
| Status | Code | Meaning |
|---|---|---|
200 | — | Updated. |
400 | — | A field is invalid, or the body has no fields (No fields to update). |
400 | environment_immutable | The body contains environment. |
400 | invalid_events, event_not_subscribable | events is invalid, as on create. |
400 | https_required, private_address, … | The URL is refused. See Refused webhook URLs. |
403 | provider_key_required | A partner key made the call. |
404 | webhook_endpoint_not_found | You have no endpoint with that ID. |
409 | webhook_endpoint_duplicate | Another 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,
"…": "…"
}
}