Update a webhook endpoint
const url = 'https://api.vaartix.com/webhooks/wh_4n8x2k7q1m9c3v5d';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://example.com","events":["email.sent"],"status":"enabled"}'};
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://api.vaartix.com/webhooks/wh_4n8x2k7q1m9c3v5d \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com", "events": [ "email.sent" ], "status": "enabled" }'Change the URL or events, or turn the endpoint off and on. Turning it off cancels its pending deliveries. Turning it back on resets its failure count.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
wh_4n8x2k7q1m9c3v5dRequest Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”The updated endpoint.
object
Endpoints are turned off automatically after 5 deliveries in a row fail every attempt.
Example
{ "id": "wh_4n8x2k7q1m9c3v5d", "events": [ "email.sent" ], "status": "enabled"}validation_error: the request is invalid. The message says which field and why.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error", "message": "to: \"priya@\" is not a valid email address." }}unauthorized: the API key is missing, invalid or revoked.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error" }}forbidden: the key cannot do this, for example a send-only key on a management endpoint.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error" }}not_found: no such resource in your team.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error" }}