---
title: SendGrid incoming webhook setup guide
description: This article describes how to use the SendGrid data source to create a webhook in your SendGrid account and send actionable events to Tealium.
url: https://docs.tealium.com/server-side/data-sources/webhooks/setup-guides/sendgrid/
---## Prerequisites

* SendGrid account
* EventStream/AudienceStream account

## How it works

SendGrid offers a webhook API that sends outgoing requests to an endpoint that you specify. These requests act like push notifications to EventStream to inform it about things that happened in your SendGrid account. When you add the SendGrid data source in the UDH, a unique endpoint will be generated that you will use to configure Event notifications in your SendGrid account.

## SendGrid data source

The SendGrid data source generates a unique URL to use as the HTTP POST URL in your SendGrid configuration. The generated URL is in the format of:

`<https://collect.tealiumiq.com/integration/event/ACCOUNT/PROFILE/DATA_SOURCE_KEY>`

To add the SendGrid data source to your Tealium Customer Data Hub profile, see [Data Sources](https://docs.tealium.com/about-data-sources/). After adding and connecting the data source, save and publish your profile.

## SendGrid setup

Once you have your data source endpoint you can proceed to your SendGrid account to create the webhook.

1. In [SendGrid](https://app.sendgrid.com/), go to [Settings &gt; Mail Settings](https://app.sendgrid.com/settings/mail_settings).
1. Turn on Event Notification.
1. In the HTTP POST URL field, paste you data source endpoint.
1. Select the Event notifications you would like to subscribe to.
1. Click the checkmark in the top corner to save these updates into your settings.

## Events and attributes

All incoming SendGrid events are automatically converted to event attributes prefixed and underscored with `sendgrid_`. For example, SendGrid webhook will send the `smpt-id` attribute to Tealium and it will be converted to `sendgrid__smpt_id` (all lowercase).


See the full list of webhook events and attributes generated by SendGrid:

* [SendGrid Event Webhook Reference](https://sendgrid.com/docs/API_Reference/Event_Webhook/event.html)

|Event Attribute| Type| Example|
|---| ---| ---|
|`sendgrid_asm_group_id`| Number| 10|
|`sendgrid_attempt`| String| "5"|
|`sendgrid_category`| String| "cat facts"|
|`sendgrid_email`| String| "example@test.com"|
|`sendgrid_event`| String| "processed", "dropped", "delivered", "deferred", "bounce", "click", "spamreport", "unsubscribe", "group_resubscribe", or "group_unsubscribe"|
|`sendgrid_ip`| String| "255.255.255.255"|
|`sendgrid_reason`| String| "500 unknown recipient"|
|`sendgrid_response`| String| "400 try again later"|
|`sendgrid_sg_event_id`| String| "sg_event_id"|
|`sendgrid_sg_message_id`| String| "sg_message_id"|
|`sendgrid_smtp_id`| String| "&lt;14c5d75ce93.dfd.64b469@ismtpd-555&gt;"|
|`sendgrid_status`| String| "5.0.0"|
|`sendgrid_timestamp`| Number| 1513299569|
|`sendgrid_url`| String| "<http://www.sendgrid.com/>"|
|`sendgrid_useragent`| String| "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"|
