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

# SendGrid

> Send transactional email, manage marketing contacts, and read delivery statistics.

SendGrid connects with an API key from your SendGrid dashboard. It sends transactional and marketing email, and reports on what happened to it.

## What you can do

**Actions** - send an email, list templates, search contacts, add or update contacts, read email statistics, list bounces.

**Triggers** - none. Use it through the assistant in chat or as an action node in an automation.

## Get your credential

<Steps>
  <Step title="Open your SendGrid dashboard">
    Sign in at [app.sendgrid.com](https://app.sendgrid.com/settings/api_keys) and open **Settings → API Keys**.
  </Step>

  <Step title="Create a key">
    Create a key and copy it - SendGrid shows it once. Keys start with `SG.`. Full Access covers
    every action here; a restricted key connects too, and only the actions its permissions cover
    will run.
  </Step>
</Steps>

## Connect

<Steps>
  <Step title="Open Integrations">
    In arg.ai, go to **Settings → Integrations** and click **Connect** on **SendGrid**.
  </Step>

  <Step title="Paste the key">Enter your API key in the API key field.</Step>

  <Step title="Save">
    arg.ai asks SendGrid what the key is permitted to do and records the answer, so the connection
    shows its real permissions. No email is sent by the check.
  </Step>
</Steps>

## Use it

* **In chat:** *"Why did opens drop last week? Pull the SendGrid statistics."*
* **In an automation:** add a **SendGrid** action node to email each row of a spreadsheet its own summary.

## Sending

A send takes a verified `from` address and one or more recipients. Supply `text`, `html`, or both - or name a dynamic template with `template_id` and pass its variables as `dynamic_template_data`, in which case the template supplies the subject and body.

The response is the queued message id, read from SendGrid's `X-Message-Id` response header. That is the handle to match against Email Activity and webhook events afterwards - SendGrid's own success response carries no body.

## Contacts and reporting

* **Search contacts** takes an SGQL query, e.g. `email LIKE '%@acme.com'`. Email comparisons must be lowercase. It returns up to 50 contacts.
* **Add or update contacts** upserts on email, so re-sending a contact merges rather than duplicates. Processing is asynchronous and the response is a job id.
* **Read email statistics** covers a date range and rolls up by day, week, or month.
* **List bounces** explains why mail to an address stopped arriving, with the SMTP reason for each.
