Skip to contentSkip to navigationSkip to topbar
On this page

Get All Event Webhooks



API Overview

api-overview page anchor

The SendGrid Event Webhook sends email event data as SendGrid processes it. This means you can receive data in nearly real-time, making it ideal to integrate with logging or monitoring systems.

Because the Event Webhook delivers data to your systems, it is also well-suited to backing up and storing event data within your infrastructure to meet your own data access and retention needs.


You can think about the types of events provided by the Event Webhook in two categories: deliverability events and engagement events.

  • Deliverability events such as "delivered," "bounced," and "processed" help you understand if your email is being delivered to your customers.
  • Engagement events such as "open," and "click" help you understand if customers are reading and interacting with your emails after they arrive.

Both types of events are important and should be monitored to understand the overall health of your email program. The Webhooks API allows you to configure your Event Webhook configurations.


Currently, data staged to be be posted through the webhooks is stored in the US.


GET/v3/user/webhooks/event/settings/all

Base url: https://api.sendgrid.com (for global users and subusers)

Base url: https://api.eu.sendgrid.com (for EU regional subusers)

This endpoint allows you to retrieve all of your Event Webhooks.

Each webhook will be returned as an object in the webhooks array with the webhook's configuration details and ID. You can use a webhook's ID to update the webhook's settings, delete the webhook, enable or disable signature verification for the webhook, and, if signature verification is enabled, retrieve the webhook's public key when signature verification is enabled.

Event settings

event-settings page anchor

Each webhook's settings determine which events will be included in the POST request by the webhook and the URL where the request will be sent. See the Event Webhook Reference for details about each event type.

The public_key property will be returned only for webhooks with signature verification enabled.

You may share one OAuth configuration across all your webhooks or create unique credentials for each. The OAuth properties will be returned only for webhooks with OAuth configured.


Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>

on-behalf-ofstringOptional

The on-behalf-of header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be "account-id" followed by the customer account's ID (e.g., on-behalf-of: account-id <account-id>). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., on-behalf-of: <subuser-username>). See On Behalf Of for more information.

Property nameTypeRequiredDescription
includestringOptional

Use this to include optional fields in the response payload. When this is set to include=account_status_change, the account_status_change field will be part of the response payload and set to false by default. See Update an event webhook for enabling this webhook notification which lets you subscribe to account status change events related to compliance action taken by SendGrid.

200

Success

SchemaExample
Property nameTypeRequiredDescriptionChild properties
max_allowednumber

The maximum number of Event Webhooks you can have enabled under your current Twilio SendGrid plan. See the Twilio SendGrid pricing page(link takes you to an external page) for more information about the features available with each plan.


webhooksarray[object]

An array of Event Webhook objects. Each object represents one of your webhooks and contains its configuration settings, including which events it is set to send in the POST request, the URL where it will send those events, and the webhook's ID.

Get All Event WebhooksLink to code sample: Get All Event Webhooks
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const request = {
5
url: `/v3/user/webhooks/event/settings/all`,
6
method: "GET",
7
};
8
9
client
10
.request(request)
11
.then(([response, body]) => {
12
console.log(response.statusCode);
13
console.log(response.body);
14
})
15
.catch((error) => {
16
console.error(error);
17
});
Include account_status_change in the response payloadLink to code sample: Include account_status_change in the response payload
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const queryParams = {
5
include: "account_status_change",
6
};
7
8
const request = {
9
url: `/v3/user/webhooks/event/settings/all`,
10
method: "GET",
11
qs: queryParams,
12
};
13
14
client
15
.request(request)
16
.then(([response, body]) => {
17
console.log(response.statusCode);
18
console.log(response.body);
19
})
20
.catch((error) => {
21
console.error(error);
22
});

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.