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

# SendGrid

# SendGrid Provider

SendGridProvider is a class that implements the SendGrid API and allows email sending through Keep.

## Authentication

This provider requires authentication.

* **api\_key**: SendGrid API key (required: True, sensitive: True)
* **from\_email**: From email address (required: True, sensitive: False)

Certain scopes may be required to perform specific actions or queries via the provider. Below is a summary of relevant scopes and their use cases:

* **email.send**: Send emails using SendGrid (mandatory) ([Documentation](https://sendgrid.com/docs/API_Reference/api_v3.html))

## In workflows

This provider can be used in workflows.

As "action" to make changes or update data, example:

```yaml theme={null}
actions:
    - name: Query sendgrid
      provider: sendgrid
      config: "{{ provider.my_provider_name }}"
      with:
        to: {value}  # To email address or list of email addresses
        subject: {value}  # Email subject
        html: {value}  # Email body
```

Check the following workflow examples:

* [consts\_and\_vars.yml](https://github.com/keephq/keep/blob/main/examples/workflows/consts_and_vars.yml)
* [sendgrid\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/sendgrid_basic.yml)

## Connecting with the Provider

To connect with the SendGrid provider and send emails through Keep, follow these steps:

1. Obtain a SendGrid API key: Visit [SendGrid API Keys](https://www.twilio.com/docs/sendgrid/api-reference/api-keys/) to obtain an API key if you don't have one already.
2. Configure the SendGrid provider in your system with the obtained API key and the `from_email` address.
3. Use the following YAML example to send an email notification using the SendGrid provider:

## Useful Links

* [SendGrid API Keys](https://sendgrid.com/docs/ui/account-and-settings/api-keys/)
* [SendGrid API Reference](https://www.twilio.com/docs/sendgrid/api-reference)
