> For the complete documentation index, see [llms.txt](https://docs.anedot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anedot.com/integrations/email-marketing-communication/sendgrid.md).

# SendGrid

SendGrid-also known as Twilio SendGrid-is a customer communication platform that provides powerful tools for transactional and marketing email.

**SendGrid**—also known as **Twilio SendGrid**—is a customer communication platform that provides powerful tools for **transactional and marketing email**. Anedot integrates directly with **SendGrid Marketing Campaigns** to help you grow your contact lists based on donor activity.

When connected, Anedot can automatically send **donor information** from donations to SendGrid as **marketing contacts**. You can optionally subscribe those contacts to specific marketing lists using List IDs.

## Connecting Anedot to SendGrid

1. In your Anedot account, go to **Settings → Integrations → Directory**.
2. Click the blue **+ New Connection** button.
3. Select **SendGrid**.
4. **Select Action Pages**: Choose which pages to sync *(default: all Action Pages)*. \*
   * To exclude pages, enter a **comma-separated list of Action Page IDs**.
5. *Optionally*, scope the integration to a specific **Team**.
6. Enter Your **SendGrid API Key**.
   1. Generate an API key in SendGrid with **Marketing Campaigns permissions** only.
      1. You may disable all other permissions.
      2. Once the API key is displayed, **copy it** and **paste it** into the Anedot integration form.
7. *Optionally*, Add **List IDs**.
   * Click the **Add** button to include **SendGrid List IDs**.
   * These control which marketing lists donors are automatically subscribed to.
   * You can include multiple List IDs—or none at all *(contacts will be added without list subscriptions)*.
8. Click **Save** to complete setup.

*You can edit your Action Pages, Team filters, List IDs, or API credentials at any time.*

## SendGrid List IDs: Where to Find Them

To get a List ID in SendGrid:

1. Go to **Marketing → Contacts → Lists**.
2. Click the list you want.
3. The **List ID** is the last part of the URL in your browser.

## Data Relays

* **Pages Supported**: We send relays for both **financial and non-financial** Action Pages.
* **What’s Included**: Donor contact data only. **Custom fields are not currently relayed.**
* **Unsent Relay Tools**: Use the **Push Unsent** feature to retry failed or unsent relays with a selected date range.
* **Failure Handling**: After **five failed relay attempts**, the integration will be marked **inactive**, and no further relays will occur until reactivated.

## Viewing Contacts in SendGrid

To find relayed donor data:

* Go to **Marketing → Contacts**.
* You’ll see contacts in two places:
  * **All Contacts**: A full list of all relayed contacts.
  * **Contact Lists**: Shows only those added to specific lists via List IDs in your integration settings.

## Field Mapping

The Anedot Fields match the Submission’s Raw Data and the Fields match the Request Body relay.

| Anedot Field              | SendGrid Field          |
| ------------------------- | ----------------------- |
| address {city}            | city                    |
| email                     | email                   |
| address {country}         | country                 |
| lastName                  | last\_name              |
| firstName                 | first\_name             |
| address {postalCode}      | postal\_code            |
| address {line1}           | address\_line\_1        |
| address {line2}           | address\_line\_2        |
| address {region}          | state\_province\_region |
| list\_id (SendGrid field) | list\_ids               |

## Payload Data

### Request Headers

```
{ }
```

### Request Body

```json
{  "contacts": [{    "city": "New Orleans",    "email": "admin@anedot.com",    "country": "US",    "last_name": "Dot",    "first_name": "Annie",    "postal_code": "70112",    "address_line_1": "1340 Poydras Street",    "address_line_2": "Suite 1770",    "state_province_region": "LA"  }],  "list_ids": ["Test"]}
```

### Response Body *(Success)*

```json
{  "job_id": "01f0a230-b384-4125-aad2-c29513ae11e3"}
```

### Response Body *(Failure)*

```json
{  "errors": [{    "field": null,    "message": "unauthorized"  }]}
```

### Response Status *(Success)*

```
202
```

### Response Status\_(Failure)\_

```
401
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.anedot.com/integrations/email-marketing-communication/sendgrid.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
