# How to Solve SendGrid's One Webhook URL Limit

[SendGrid’s Event Webhook](https://docs.sendgrid.com/for-developers/tracking-events/getting-started-event-webhook) only allows for one webhook URL. However, you may want your webhooks to go to multiple services, for example email analytics on top of your servers.

In this article, I’ll explain how to bypass this limitation by duplicating and routing webhooks within Hookdeck.

## How to add Hookdeck’s webhook URL on SendGrid

1. Copy the source URL in Hookdeck.

![Copy Hookdeck URL screenshot](./images/copy-hookdeck-url-.jpg)

1. Paste the source URL in SendGrid.

![Add webhook URL on SendGrid screenshot](./images/add-webhook-url-on-sendgrid.jpg)

1. Click Save.
2. Confirm Hookdeck receives SendGrid event webhooks.

<iframe src="https://demo.arcade.software/tZ2wYw1gdgUFPKYAGTYQ?embed" frameborder="0" loading="lazy" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>

## How to duplicate webhooks with Hookdeck

Great! Now that you are receiving SendGrid’s webhook in Hookdeck, we’ll take advantage of the fanning-out behavior. To duplicate (or fan-out) the webhook to a second destination, follow the steps outlined below.

1. Create a new Connection with the same `source`.
2. Trigger an Event to validate that the webhook was duplicated.

<iframe src="https://demo.arcade.software/646chHtADcm6xL0z2ete?embed" frameborder="0" loading="lazy" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>

But what if you only want specific webhooks to reach a connection?

## How to route webhooks with Hookdeck

By adding a filter (conditional logic in JSON), you can define the criteria and choose which webhooks will be delivered to a connection.

### Example: Filter SendGrid webhooks based on status

Lets say you only want webhooks with the status “cancelled” delivered to your analytics connection. You will add this JSON as a filter to your connection for the following payload.

Hookdeck filter:

```json
[
  {
    "event": "cancelled"
  }
]

```

SendGrid webhook payload:

```json
[
  {
    "email": "example@test.com",
    "timestamp": 1669193462,
    "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>",
    "event": "processed",
    "category": ["cat facts"],
    "sg_event_id": "r4EQlb4UpE6iho4_z-RmLQ==",
    "sg_message_id": "14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0"
  }
]

```

Hookdeck walkthrough:

<iframe src="https://demo.arcade.software/ky4So2AJDo0aCgFDcQjf?embed" frameborder="0" loading="lazy" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>

## Conclusion

In this article, you learned how to bypass SendGrid’s one webhook URL limitation. With Hookdeck we were able to use one webhook URL, and then duplicate and route webhooks to fit our use case.

With Hookdeck’s transformations, you can even change the payload before arriving to your destination! Read the docs [here](https://hookdeck.com/docs/transformations).