> ## Documentation Index
> Fetch the complete documentation index at: https://docs.castled.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Sendgrid

## 1. Sender Authentication

The type of Sender Identity you use to send email can impact your deliverability
and what your recipients see in their inbox.Sendgrid provide the option of
**Domain Authentication** and **Single Sender Verification**.

![](https://mintlify.s3-us-west-1.amazonaws.com/castled/images/sendgrid-1.png)

Follow the Sendgrid documentation to setup the Sender Identity for your domain.

> [!NOTE]
>
> Configure atleast one verified sender as Castled displays only the verified senders returned by the sengrid API.

![](https://mintlify.s3-us-west-1.amazonaws.com/castled/images/sendgrid-2.png)

## 2. Create API Key

Create an API Key with all the required permission to be used by Castled.

![](https://mintlify.s3-us-west-1.amazonaws.com/castled/images/sendgrid-3.png)

![](https://mintlify.s3-us-west-1.amazonaws.com/castled/images/sendgrid-4.png)

![](https://mintlify.s3-us-west-1.amazonaws.com/castled/images/sendgrid-5.png)

> [!NOTE]
>
> Make sure the API Key is generated only after the Verified senders are added
> as part of Sender Authentication

![](https://mintlify.s3-us-west-1.amazonaws.com/castled/images/sendgrid-6.png)

## 3. Configure Event Webhook

For enabling Castled to recieve the email event callbacks webhook needs to be
configured. The URL mentioned below needs to be configured so that the events
callbacks can be listened and processed by Castled.

```
https://castled.io/backend/v1/email-webhook/sendgrid
```

![](https://mintlify.s3-us-west-1.amazonaws.com/castled/images/sendgrid-7.png)

> [!NOTE]
>
> Make sure the webhook is configured to receive and handle the event callbacks.

## 4. Configure the API Key generated in Castled Settings

If Sendgrid is used as email provider, Select Sendgrid as the provider and
capture the API Key generated in step 2.

* Select Sendgrid as the email provider

![](https://mintlify.s3-us-west-1.amazonaws.com/castled/images/sendgrid-8.png)

* Configure the API Key copied from Step 2 above

![](https://mintlify.s3-us-west-1.amazonaws.com/castled/images/sendgrid-9.png)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.