Change a webhook subscription
PATCH
/event-subscriptions/{id}
const url = 'https://app.surveyrock.com/api/v1/event-subscriptions/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","url":"example","event_types":["response.completed"],"status":"active"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://app.surveyrock.com/api/v1/event-subscriptions/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "url": "example", "event_types": [ "response.completed" ], "status": "active" }'Change name, url (webhooks only), event_types, or status. Set status to active to resume a paused or disabled subscription (its failure count is cleared and its destination is checked again) or to paused to stop sending without losing what is queued. A subscription’s mode cannot change.
Changing the URL emails the workspace’s owners and admins.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Header Parameters
Section titled “Header Parameters”Idempotency-Key
string
1 to 128 characters, chosen by the caller. A retry with the same key and body replays the first response
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
string
url
string
event_types
Array<string>
status
string
Responses
Section titled “Responses”The subscription as it now is
The plan does not include webhooks (feature_locked), or the token lacks events:write
subscription_not_found
duplicate_subscription
validation_failed: each error names the field