Webhooks

Manage webhook endpoints

Configure webhooks to receive real-time notifications about events in your Mailtrap account. For a complete guide, see Webhooksarrow-up-right.

List webhooks

get

Returns all webhooks for the account.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
account_idintegerRequired

Account ID

Example: 1
Responses
chevron-right
200

List of webhooks

application/json
get
/api/accounts/{account_id}/webhooks
cURL

Create a webhook

post

Create a new webhook for the account. The response includes a signing_secret that is used to verify webhook signaturesarrow-up-right.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
account_idintegerRequired

Account ID

Example: 1
Body
Responses
chevron-right
200

Webhook created successfully

application/json
post
/api/accounts/{account_id}/webhooks
cURL

Get a webhook

get

Returns a single webhook by ID.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
account_idintegerRequired

Account ID

Example: 1
webhook_idintegerRequired

Webhook ID

Example: 1
Responses
chevron-right
200

Webhook details

application/json
get
/api/accounts/{account_id}/webhooks/{webhook_id}
cURL

Delete a webhook

delete

Permanently delete a webhook.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
account_idintegerRequired

Account ID

Example: 1
webhook_idintegerRequired

Webhook ID

Example: 1
Responses
chevron-right
200

Webhook deleted successfully

application/json
delete
/api/accounts/{account_id}/webhooks/{webhook_id}
cURL

Update a webhook

patch

Update an existing webhook.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
account_idintegerRequired

Account ID

Example: 1
webhook_idintegerRequired

Webhook ID

Example: 1
Body
Responses
chevron-right
200

Webhook updated successfully

application/json
patch
/api/accounts/{account_id}/webhooks/{webhook_id}
cURL

Last updated

Was this helpful?