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

# SendGrid

> Manually configure SendGrid event webhooks so WorldVisa can track delivered, opened, clicked, bounced, and spam-report events for outbound transactional emails.

If the API key used in your WorldVisa SendGrid integration does not have the required permissions, the automatic setup will fail with an `access forbidden` error. This indicates that WorldVisa lacks the permissions needed to configure the webhook on your behalf.

This guide will walk you through resolving this issue.

## Step 1: Update SendGrid API key permissions

First, you need to update your API key in your SendGrid account to grant the necessary permissions.

1. Log in to your SendGrid account.
2. Under **Settings**, click **API Keys**.
3. Choose whether to edit an existing key or create a new one:
   * To create a new API key, click **Create API Key**.
   * To update an existing key, click the settings icon next to it and select **Edit API Key**.

     ![Edit existing key or creating a new one](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/channels-and-providers/email/activity-tracking/sendgrid-api.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=6144108a25229926997e880b4653eaef)
4. Set the key permissions to either:
   * **Full Access**, or
   * Custom Access with at least the following enabled:
     * **Mail Send**
     * **Mail Settings**

       ![Custom access](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/channels-and-providers/email/activity-tracking/custom-access.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=ad11f572963c8022e65028de8a09d4be)
5. If you created a new key, return to the WorldVisa dashboard and update your SendGrid integration settings with the new API key.

## Step 2: Enable activity tracking in WorldVisa

Once your API key has the correct permissions, return to your WorldVisa dashboard to complete the setup.

1. Navigate to the **Integrations** page and select your **SendGrid** integration.
2. Click the **Email Activity Tracking** toggle to enable it.

With the updated permissions, WorldVisa should now successfully auto-configure the webhook for you. You should see a green checkmark indicating that the webhook is active. If you see this, your setup is complete.

## Step 3: Manual configuration (only if auto-configuration fails)

If the automatic configuration fails for any reason, or if you prefer to set it up manually, follow these steps.

### Part 1: Configure the webhook in SendGrid

1. In your WorldVisa SendGrid integration settings, enable the **Email Activity Tracking** toggle to reveal the **Inbound Webhook URL**
2. Copy the this Inbound Webhook URL.
3. Log in to the SendGrid dashboard.
4. Go to the Settings page, and click **Mail Settings**.
5. Click on **Event Webhook**.
6. Click **Create new webhook**

   ![Create new SendGrid webhook](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/channels-and-providers/email/activity-tracking/sendgrid-webhook.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=45b7b443a84a543e3cd3d5c0d72fcb79)
7. Give the webhook a friendly name.
8. Paste the Inbound Webhook URL copied from WorldVisa into the **Post URL** field.
9. Under **Actions to be posted**, select the events WorldVisa supports that you want to track

   ![Add new event webhook](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/channels-and-providers/email/activity-tracking/add-new-event-webhook.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=edf8f4d7c897c6f06277b2e7f03ffde8)
10. Under Singnature Verification, enable **Enable Signed Event Webhook**
11. Click **Save**

### Part 2: Add the signing key to WorldVisa (Recommended)

For enhanced security, you should add a signing key to verify that webhooks are coming from SendGrid.

1. Log in to the SendGrid dashboard.
2. Go to the Settings page, and click **Mail Settings**.
3. Click the settings icon next to the webhhok a menu will appear.
4. Click **Edit**.

   ![Add new event webhook](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/channels-and-providers/email/activity-tracking/edit-sendgrid-webhook.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=4ee5d48bc7806fbeac71a26865f10287)
5. Enable **Signed Webhook Verification** if is hasn't been enabled. A **Verification Key** will be displayed.
6. Copy the verification key.

   ![Add new event webhook](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/channels-and-providers/email/activity-tracking/sendgrid-verification-key.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=ee8a0e9c976224dcd99487c58d994633)
7. Return to your WorldVisa SendGrid integration settings.
8. Paste the key you just copied from SendGrid into the **Inbound Webhook Signing Key** field.

   ![Add new event webhook](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/channels-and-providers/email/activity-tracking/inbound-signing-key-sendgrid.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=e405c35b709d2ca6f948afd15eea94ca)
9. Click **Save**.

Your SendGrid integration is now manually configured to send activity data to WorldVisa.


## Related topics

- [Integrations](https://docs.worldvisagroup.com/developers/concepts/integrations.md)
- [How WorldVisa Console works](https://docs.worldvisagroup.com/developers/how-worldvisa-console-works.md)
- [How do workflows work in WorldVisa?](https://docs.worldvisagroup.com/developers/concepts/workflows.md)
- [SendGrid Email Integration with WorldVisa](https://docs.worldvisagroup.com/developers/integrations/email/sendgrid.md)


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