Skip to main content
POST
Create Webhook

Authorizations

Authorization
string
header
required

API key for authentication

Body

application/json

Request body for creating a webhook

name
string
required

Name of the webhook

Maximum string length: 255
Example:

"Order Notifications"

url
string<uri>
required

URL where webhook events will be sent

Maximum string length: 2048
Example:

"https://example.com/webhook"

auth_type
enum<string>
required

Authentication type for the webhook

Available options:
none,
basic,
oauth2
Example:

"basic"

events_mode
enum<string>
required

Whether to receive all events or only selected ones

Available options:
all,
selected
Example:

"selected"

auth_username
string

Username for basic authentication (required when auth_type is 'basic')

Maximum string length: 255
Example:

"user"

auth_password
string

Password for basic authentication (required when auth_type is 'basic')

Maximum string length: 255
Example:

"secret"

oauth_client_id
string

OAuth2 client ID (required when auth_type is 'oauth2')

Maximum string length: 255
oauth_client_secret
string

OAuth2 client secret (required when auth_type is 'oauth2')

Maximum string length: 255
oauth_token_url
string<uri>

OAuth2 token URL (required when auth_type is 'oauth2')

Maximum string length: 2048
events
enum<string>[]

List of event types to receive (required when events_mode is 'selected'). Fully-prefixed names such as message.delivery are canonical; short names (delivery) and the legacy engagament.* prefix are accepted for backwards compatibility and are normalised to the fully-prefixed form.

Available options:
message.injection,
message.delivery,
message.bounce,
message.delay,
message.out_of_band,
message.spam_complaint,
message.policy_rejection,
engagement.click,
engagement.open,
engagement.initial_open,
engagement.amp_click,
engagement.amp_open,
engagement.amp_initial_open,
generation.generation_failure,
generation.generation_rejection,
unsubscribe.list_unsubscribe,
unsubscribe.link_unsubscribe,
relay.relay_injection,
relay.relay_rejection,
relay.relay_delivery,
relay.relay_tempfail,
relay.relay_permfail
Example:

Response

Webhook created successfully

Response after creating a webhook

message
string
required

Human-readable response message

Example:

"Webhook created successfully."

data
object
required

View of a webhook