Layers
Partner APIAPI referenceWebhooks

PATCH /v1/webhook-endpoints/:endpointId

Update a webhook endpoint's url, events, description, or status.

View as Markdown
PATCH/v1/webhook-endpoints/{endpointId}
Phase 1stableidempotent
Auth
Bearer

Partial update. At least one field is required. Setting status: "active" on an auto-paused endpoint also resets consecutiveFailureCount so the dispatcher doesn't immediately re-pause on the first delivery.

Headers
  • Idempotency-Key
    string (UUID)optional
    Replays within the idempotency window.
Body
  • url
    stringoptional
    Updated endpoint URL. HTTPS required in prod.
  • events
    string[]optional
    1–50 event types from the catalog. Replaces the existing subscription list.
  • description
    string | nulloptional
    Human label; pass `null` to clear.
  • metadata
    object | nulloptional
    Merged into the endpoint's existing metadata per key (Stripe-style): omitted keys are preserved, sent keys are added/overwritten, an empty value unsets a key, and `null` clears all.
  • status
    stringoptional
    `active` or `paused`. Cannot be set to `auto_paused` by partners - that's the dispatcher's lane.
  • scope
    "own" | "all_children"optional
    Re-target delivery scope. all_children (the firehose — this org plus every direct child, each tagged with data.organizationId) requires an org:admin key; otherwise 403 FORBIDDEN_SCOPE. See create.

Example

curl -X PATCH https://api.layers.com/v1/webhook-endpoints/d4c71b62-... \
  -H "Authorization: Bearer $LAYERS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "events": ["job.completed", "content.approved", "post.published"] }'
200OK - returns the updated endpoint

Errors

StatusCodeWhen
422VALIDATIONNo fields supplied, unknown event type, URL invalid, events empty/too long.
404NOT_FOUNDEndpoint not owned by the calling org.
409IDEMPOTENCY_CONFLICTIdempotency-Key reused with a different body.

See also

On this page