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

# Webhook deliveries

> Customize your Omni deliveries with webhooks.

If you want to customize your Omni deliveries, webhooks may be a good fit. While you can specify some things - like the email sender for email deliveries or the channel message for Slack deliveries - webhooks give you the ability to create context-specific workflows.

For example, you could use a platform like [Zapier](https://www.zapier.com) to catch Omni webhooks and perform different actions based on data values, such as those for CSV-formatted deliveries.

## Requirements

To successfully use Omni webhook deliveries, you'll need:

* To have the **Webhook** destination in [**Settings > Deliveries**](https://docs.omni.co/administration/settings/deliveries.md#destinations) enabled
* A webhook that returns an HTTP `200` status response upon delivery. A different status could cause delivery retries or failures.
* A public HTTPS webhook URL. Omni rejects IP addresses in private, loopback, link-local, or reserved ranges, and `.internal`, `.local`, or `.localhost` hosts.

## Creating a webhook delivery

### 1. Create a webhook URL

Prior to using webhooks as a delivery destination, you'll need to create a webhook URL for Omni to send requests to. For example, using Zapier's webhook trigger in a Zap will create a webhook URL for you to use.

> [!NOTE]
>
> If access to your webhook server is restricted, you'll need to whitelist Omni's IP addresses to ensure deliveries are successful.
>
> Omni's IP addresses can be found on any database connection's page, accessed by navigating to **Settings > Connections** and clicking a connection. **All IP addresses on this page must be included in the allowlist.**

### 2. Configure the delivery settings

1. Navigate to a **published** dashboard or workbook.
2. Click **File > Deliveries & Alerts**. The delivery options will display on the left side of the page.
3. Fill in the following:

   * **Delivery** - Select **Schedule** or **Alert**.
   * **Send** - Select the content to be delivered.
   * **Destination** - Select **Webhook**.
   * **Name** - Enter a name for the delivery.

**If creating an alert**, use the **Alert** tab to define the conditions that must be met to trigger the delivery. For example, you have a chart that tracks the **Total sales** for your ecommerce company. Using an alert, you can trigger a delivery when the total of your sales has changed.

Click **Preview** in the form footer to see a live preview of the delivery, matching the current format and print options, in the dashboard's content area. Click **Preview** again to close it.

> [!NOTE]
>
> **Preview** is unavailable for single-chart (tile) deliveries and for spreadsheet formats (CSV, XLSX).

### 3. Configure the delivery schedule

In this step, you'll define the cadence for the delivery:

* For **schedules**, this determines when Omni will deliver the specified content to the destination
* For **alerts**, this tells Omni when to check if the current query results meet the conditions required to send the delivery

Schedules can be defined using the visual options or with cron:

> [accordion] Visual schedule builder
>
> Easy point-and-click schedule builder
>
> Use the UI options (**Daily**, **Weekly**, etc.) to select a time period.
>
> By default, schedules are set to send in the local timezone of the delivery creator's computer. Use the **Times are in** drop down to change the timezone.

> [accordion] Custom cron schedule (Advanced)
>
> Code-based granular timing control
>
> A cron expression is a string that describes the individual details of a schedule:
>
> | Order | Unit | Allowed values | Allowed special characters |
> | - | - | - | - |
> | 1 | minute | 0-59 | \* , - / |
> | 2 | hour | 0-23 | \* , - / |
> | 3 | day of month | 1-31 | \* , - / L W ? |
> | 4 | month | 1-12 or JAN-DEC | \* , - / |
> | 5 | day of week | 1-7 or SUN-SAT | \* , - / L W ? |
>
> Using cron, you can create schedules like the following:
>
> ```markdown title="At 9:00 AM every day" theme={null}
> 0 9 ? * * *
> ```
>
> ```markdown title="At 6:30AM on the last day of the month" theme={null}
> 30 6 L * ? *
> ```
>
> ```markdown title="At 8:45 AM every day, Monday through Friday" theme={null}
> 45 8 ? * MON-FRI *
> ```
>
> Omni uses Amazon Web Services' (AWS) syntax for cron expressions. Refer to the [AWS documentation](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html) for more information. By default, the most frequent you can configure a schedule is hourly.
>
> > [!TIP]
> >
> > If your organization has [AI enabled](https://docs.omni.co/ai/settings/features.md), you can use the AI cron generator to create cron expressions from natural language. Click the sparkle icon next to the cron input field and describe your desired schedule, such as "every weekday at 9am" or "first Monday of each month at noon."

> [!TIP]
>
> Schedule send timezone may be different than query run timezone. For example, if your **Database timezone** is `UTC` with no other timezone conversion settings and you set your schedule to send at `12:00 PM PST`, the query will execute at `8:00 PM UTC`.
>
> Refer to your [connection timezone settings](https://docs.omni.co/connect-data/timezones.md) for more information.

### 4. Select format and filter options

> [!TIP]
>
> You can use filters to customize content for different recipients! For example, set a filter to `A` in a scheduled delivery to recipient A, and in another scheduled delivery to recipient B, set a filter to `B`.

In the **Dashboard** or **Chart** tab, you can:

* **Select the format of the content**, such as PNG, PDF, XLSX, or CSV.
* **Lightly customize the contents and layout**, such as expanding tables to include up to 1,000 rows, hiding filter values, or arranging tiles in a single column.
* **Select the page(s) to include in the dashboard delivery**. This is applicable only to [advanced layouts](https://docs.omni.co/visualize-present/dashboards/advanced-layout) with multiple pages.

  **Note**: PNGs can only include one page. You'll need to create multiple deliveries to output a PNG for each page.
* **Override the query timezone for the delivery** using the [timezone picker](https://docs.omni.co/visualize-present/dashboards/timezone-override.md). The picker label changes based on whether **Personalize delivery with recipient user attributes** is enabled (**Recipient's timezone** when enabled, **Default timezone** when disabled).

  This setting affects the content of queries included in the delivery, not the timing of the delivery itself. Use the **Schedule** tab to define when content should be delivered.
* **Set filter or control values for the delivery**. Some formats will have additional customization options. PDF formats, for example, will allow you to specify the orientation and page size for the PDF.

  For dashboard deliveries, the default filters and controls will automatically be applied upon creation. Subsequent default filter value updates will not change the filter values set for existing deliveries.

### 5. Configure webhook settings

The last step is to configure the webhook settings. Click the **Webhook** tab and fill in the following:

* **URL** - Enter the webhook URL you created in [step 1 of this guide](https://docs.omni.co/share/deliveries/webhooks.md#webhook-url).
* **File Name (Without extension)** - Optionally specify a file name for the delivery, leaving out a file extension like `.png`. [Mustache references](https://docs.omni.co/share/deliveries/dynamic-content.md) are supported.

### 6. Test the delivery

If you want to test the delivery before saving, click the **Test Now** button in the bottom left corner of the page. This will send the dashboard/chart to the destination using the current settings. For example, using **Test Now** would send the delivery to all **Recipients**.

> [!NOTE]
>
> The **Test Now** button will be unavailable for alerts if the **Condition type** is `Results have changed` or `Results have stayed the same`. A workaround is to use the **Send Now** option to manually trigger the delivery, which is available once the delivery has been saved.
>
> Save the alert and then click the  icon to display the **Send Now** option. This will initiate a check on the alert condition - if the condition isn't met, the delivery will show as successful but not send anything.

### 7. Save the delivery

When finished, click **Save** to create the delivery.

## Request formats

Omni sends an HTTP `POST` request to your webhook URL. The selected delivery format determines the request body and `Content-Type` header. Configure your receiver to accept the format you select.

Available formats depend on the selected content. For example, single spreadsheet tiles do not support CSV or JSON deliveries.

Although link-only and JSON file deliveries both use `application/json`, their bodies differ. Link-only sends an object with a `url` property; JSON sends an array of row objects. A receiver configured for the link-only object needs different handling for JSON exports.

### Link-only

Link-only deliveries use `Content-Type: application/json`. The body is a JSON object with a `url` property:

```json title="Webhook delivery request body" theme={null}
{
  "url": "<dashboard_url>"
}
```

### File deliveries

File deliveries send the file content directly in the request body, without a JSON attachment wrapper or `multipart/form-data` encoding.

| Delivery format | `Content-Type` | Request body |
| - | - | - |
| JSON (single tile) | `application/json` | An array of exported row objects |
| CSV (single tile) | `text/csv` | CSV text |
| CSV (whole dashboard) | `application/zip` | ZIP archive containing CSV files |
| PNG | `image/png` | PNG file bytes |
| PDF | `application/pdf` | PDF file bytes |
| Excel | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` | XLSX file bytes |

File deliveries also include these headers:

* `X-Filename` - The filename, including its extension. Uses the configured **File Name (Without extension)** when provided; otherwise, uses the export's filename.
* `Content-Length` - The file size in bytes, when available. Otherwise, the request uses `Transfer-Encoding: chunked`.

For example, a JSON delivery with **File Name (Without extension)** set to `orders` includes these headers and body.

```http title="Example JSON file headers" theme={null}
Content-Type: application/json
X-Filename: orders.json
```

```json title="Example JSON file body" theme={null}
[
  { "Country": "France", "Orders": 120 },
  { "Country": "Germany", "Orders": 95 }
]
```

A single-tile CSV delivery uses `Content-Type: text/csv` and sends CSV text:

```csv title="Example CSV file body" theme={null}
Country,Orders
France,120
Germany,95
```

## Troubleshooting

> [accordion] Link-only deliveries work, but file deliveries fail
>
> Check that your webhook receiver accepts the selected format's `Content-Type` and request body. For workflow tools such as Power Automate, check the trigger's expected schema and the actions that read the body.
>
> If your receiver validates JSON against a schema, configure it to accept an array of row objects. PNG, PDF, and Excel exports need binary file handling. These formats do not contain the `url` property from a link-only delivery.
>
> Inspect the receiver's trigger or run history for the failed request, then use **Test Now** with the format you want to deliver.

> [accordion] Webhook URL is no longer valid
>
> Omni requires a public HTTPS webhook URL, rejecting IP addresses in private, loopback, link-local, or reserved ranges, and `.internal`, `.local`, or `.localhost` hosts.
>
> If a saved delivery's webhook URL is invalid, change the URL to a valid URL. You'll then be able to make other changes to the delivery settings.


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