Skip to content

Update a webhook endpoint

PATCH
/webhooks/{id}
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.

id
required
string

Example

wh_4n8x2k7q1m9c3v5d
Media typeapplication/json
object
url
string format: uri
events
Array<string>
>= 1 items
Allowed values: email.sent email.delivered email.delivery_delayed email.bounced email.complained email.rejected email.rendering_failure email.suppressed email.opened email.clicked
status
string
Allowed values: enabled disabled

The updated endpoint.

Media typeapplication/json
object
id
string
url
string format: uri
events
Array<string>
Allowed values: email.sent email.delivered email.delivery_delayed email.bounced email.complained email.rejected email.rendering_failure email.suppressed email.opened email.clicked
status

Endpoints are turned off automatically after 5 deliveries in a row fail every attempt.

string
Allowed values: enabled disabled
createdAt
string format: date-time

Example

{
"id": "wh_4n8x2k7q1m9c3v5d",
"events": [
"email.sent"
],
"status": "enabled"
}

validation_error: the request is invalid. The message says which field and why.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused domain_needs_review content_rejected idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

Example

{
"error": {
"type": "validation_error",
"message": "to: \"priya@\" is not a valid email address."
}
}

unauthorized: the API key is missing, invalid or revoked.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused domain_needs_review content_rejected idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

Example

{
"error": {
"type": "validation_error"
}
}

forbidden: the key cannot do this, for example a send-only key on a management endpoint.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused domain_needs_review content_rejected idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

Example

{
"error": {
"type": "validation_error"
}
}

not_found: no such resource in your team.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused domain_needs_review content_rejected idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

Example

{
"error": {
"type": "validation_error"
}
}