# Webhook Destination Config Reference


> Complete Rudder CLI reference for the Webhook destination config keys, headers, source types, and secrets.



[Webhook](https://www.rudderstack.com/docs/destinations/webhooks/setup-guide/) sends each event, unmodified, to an endpoint you own. For request mapping, authentication modes, or batching, use [HTTP Webhook](https://www.rudderstack.com/docs/rudder-cli/destination-types/http-webhook/) instead.

In a Webhook destination spec:

- `type: webhook`
- `definition_version: 1`

## Sample configuration

```yaml
version: rudder/v1
kind: destination
metadata:
  name: events-webhook-prod
spec:
  id: events-webhook-prod
  display_name: Events Webhook Production
  type: webhook
  definition_version: 1
  enabled: true
  config:
    webhook_url: https://hooks.example.com/rudderstack
    webhook_method: POST
    headers:
      - from: X-Signing-Key
        to: "{{ .WEBHOOK_SIGNING_KEY }}"
      - from: X-Environment
        to: "{{ .WEBHOOK_ENVIRONMENT }}"

    connection_mode:
      web: cloud
      cloud: cloud
    consent_management:
      web:
        - provider: oneTrust
          consents:
            - analytics
```

The above example sets two custom headers, and supplies both values through variables because every header value is a secret — see [Headers](#headers).

## Config keys

`config` accepts only the keys listed below. The [shared config key rules](https://www.rudderstack.com/docs/rudder-cli/destination-types/#config-key-rules) cover unknown keys, defaults, and immutability.

### Endpoint

<div class="rs-ckeys">
<div class="rs-ckey" id="webhook_url">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">webhook_url</p>Required</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Endpoint RudderStack sends events to.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Must be a public domain URL: <code>http</code> or <code>https</code>, at least one dot-separated label followed by an alphabetic top-level domain, an optional port, and an optional path.</li>
<li><code>localhost</code> addresses and <code>&lt;name&gt;.ngrok.io</code> addresses are rejected.</li>
<li>A <code>{{ path || fallback }}</code> template is accepted in place of a literal.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  To change the path per event, use a transformation — see <a href="https://www.rudderstack.com/docs/destinations/webhooks/setup-guide/#add-dynamic-path-to-base-url" >Add dynamic path to base URL</a>.
</div>

</div>

<div class="rs-ckey" id="webhook_method">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">webhook_method</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>POST</code>
  </p>
<p class="rs-ckey__field">
  Description:
  HTTP method of the outgoing request.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>One of <code>POST</code>, <code>PUT</code>, <code>PATCH</code>, <code>GET</code>, or <code>DELETE</code>.</li>
</ul>

</div>

</div>

</div>

### Headers

**Warning**

In this destination, `from` is the header **name** and `to` is its **value**. That&#39;s the reverse of [HTTP Webhook&#39;s `headers`](https://www.rudderstack.com/docs/rudder-cli/destination-types/http-webhook/#headers), where `to` is the name.

Swapping them doesn&#39;t fail validation — it sends a header named after your value.

<div class="rs-ckeys">
<div class="rs-ckey" id="headers">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">headers</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of objects</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Custom headers added to every request. Both fields are strings, so quote a number: <code>to: &quot;5&quot;</code>. An unquoted number fails validation.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>from</code> — header name, for example <code>content-type</code>.</li>
<li><code>to</code> — header value, for example <code>application/json</code>. <strong>Secret</strong> — see <a href="#secrets" >Secrets</a>.</li>
<li>Each is at most 1000 characters, and must not contain line breaks. A <code>{{ path || fallback }}</code> template is accepted in place of a literal.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <p>RudderStack adds <code>user-agent: RudderLabs</code> and <code>content-type: application/json</code> to <code>POST</code> and <code>PUT</code> requests on its own.</p>
<div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">headers:
  - from: X-Signing-Key
    to: &#34;{{ .WEBHOOK_SIGNING_KEY }}&#34;</code></pre></div>
</div><p>To set a header from the event itself, use a transformation — see <a href="https://www.rudderstack.com/docs/destinations/webhooks/setup-guide/#add-dynamic-header-to-events" >Add dynamic header to events</a>.</p>

</div>

</div>

</div>

### Per-source keys

Both keys are objects keyed by the local source type — the tokens listed under [Source types](#source-types). A key naming a source type this destination doesn't support fails validation.

<div class="rs-ckeys">
<div class="rs-ckey" id="connection_mode">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">connection_mode</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Maps each source type you connect to the mode its events reach the endpoint in, using the modes in <a href="#source-types" >Source types</a>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>An entry is required for each source type you connect — see <a href="#connect-a-source" >Connect a source</a>.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">connection_mode:
  web: cloud
  cloud: cloud</code></pre></div>
</div>
</div>

</div>

<div class="rs-ckey" id="consent_management">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">consent_management</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Consent provider configuration per source type. The entry shape, accepted providers, and the rules on <code>resolution_strategy</code> and <code>consents</code> are shared across all destination types — see <a href="https://www.rudderstack.com/docs/rudder-cli/destination-types/#consent-management" >Consent management</a>.
</p>

</div>

</div>

## Source types

Webhook accepts events from these source types in the mentioned connection modes:

| Source type | Connection mode |
| :-----| :-----|
| `android` | `cloud` |
| `android_kotlin` | `cloud` |
| `ios` | `cloud` |
| `ios_swift` | `cloud` |
| `web` | `cloud` |
| `unity` | `cloud` |
| `cloud` | `cloud` |
| `react_native` | `cloud` |
| `flutter` | `cloud` |
| `cordova` | `cloud` |
| `warehouse` | `cloud` |

Every source type is `cloud` only — events reach the endpoint from RudderStack's servers, never in device mode.

`warehouse` is the token a [Reverse ETL source](https://www.rudderstack.com/docs/sources/reverse-etl/) resolves to. Rudder CLI manages the destination’s `warehouse` entry — if the destination is connected to a Reverse ETL source, set `connection_mode.warehouse: cloud` in its spec, or `apply` removes it.

Rudder CLI can also declare the Reverse ETL connection itself, for the types listed under [Supported destinations](https://www.rudderstack.com/docs/rudder-cli/yaml-retl-connections/#supported-destinations) — see [Manage Reverse ETL Connections using Rudder CLI](https://www.rudderstack.com/docs/rudder-cli/retl-connections/).

**Info:** The dashboard additionally offers Webhook to AMP and Shopify sources. Rudder CLI doesn&#39;t manage those connections, so `amp` and `shopify` are invalid here.

## Connect a source

An event stream connection to this destination is checked against two rules at `validate` time.

**The source's type must be supported.** A source's type resolves to one of the tokens above before the check — a JavaScript source resolves to `web`, and webhook and server-side SDK sources resolve to `cloud`. Every type an event stream source can resolve to is supported here, so this check always passes.

**The destination config must carry a `connection_mode` entry for that source type.** This lives on the destination spec, not on the [connection spec](https://www.rudderstack.com/docs/rudder-cli/yaml-connections/). Without it:

```text
destination 'events-webhook-prod' config has no 'connection_mode' entry for source type 'web'
```

Webhook needs no additional config keys to connect a source of any type.

## Secrets

Every `headers` entry's `to` value — the header value — is secret. Write each as a `{{ .VAR }}` reference and supply the value at apply time:

```yaml
config:
  headers:
    - from: X-Signing-Key
      to: "{{ .WEBHOOK_SIGNING_KEY }}"
```

```bash
export RUDDER_WEBHOOK_SIGNING_KEY="..."
rudder-cli apply

# or
rudder-cli apply --var-file secrets.vars.yaml
```

Note that:

- Header values are masked as a group, so even a constant like `application/json` is treated as a secret.
- `rudder-cli import` writes only the secrets the API returns, as `{{ .VAR }}` references, and leaves the others out. Add any secret key it leaves out, then supply the variables before you apply — see [Secrets](https://www.rudderstack.com/docs/rudder-cli/destination-types/#secrets).
- Header names (`from`) aren't secret and are imported as-is.

See [How to Use Variable Substitution in Rudder CLI](https://www.rudderstack.com/docs/rudder-cli/variable-substitution/).

## Changes by release

<table>
  <thead>
    <tr>
      <th>Version</th>
      <th>Change</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>v0.29.0</td>
      <td><strong>Breaking:</strong> A <code>null</code> config value, written as <code>key: null</code>, <code>key: ~</code>, or <code>key:</code> with no value, fails <code>validate</code> with <code>'&lt;key&gt;' must not be null; set a value or remove the key</code>. Earlier releases accepted it: a top-level null planned an update on every <code>apply</code>, and a null inside a list item failed at the API.<br><strong>What to do:</strong> Remove the key to leave it unset, or give it a value.</td>
    </tr>
    <tr>
      <td>v0.29.0</td>
      <td><strong>Breaking:</strong> An empty string, <code>&quot;&quot;</code>, on a key that takes one of a fixed set of values fails <code>validate</code> with <code>'&lt;key&gt;' must be one of [...]</code>, unless <code>&quot;&quot;</code> is one of the key&rsquo;s values. Earlier releases accepted it, and the API rejected it at <code>apply</code>.<br><strong>What to do:</strong> Remove the key to leave it unset, or set one of the listed values.</td>
    </tr>
    <tr>
      <td>v0.29.0</td>
      <td><strong>Changed:</strong> <code>validate</code> warns when a secret key holds anything but one <code>{{ .VAR }}</code> reference with no default, and when one variable fills two secret keys. It also masks secret values in the lines it prints.</td>
    </tr>
    <tr>
      <td>v0.29.0</td>
      <td><strong>Changed:</strong> <code>rudder-cli import</code> writes each secret reference single-quoted, as <code>'{{ .VAR }}'</code>, so a value containing double quotes, like a JSON key file, substitutes as a string. A single quote in a value that fills such a reference is written as <code>''</code>.<br><strong>What to do:</strong> In a spec imported by an earlier release, quote each reference to a JSON value by hand: <code>'{{ .VAR }}'</code>.</td>
    </tr>
    <tr>
      <td>v0.29.0</td>
      <td><strong>Changed:</strong> <code>validate</code> reports a value of the wrong type once per key, such as <code>'email' must be a string</code>, instead of one raw decoding error.</td>
    </tr>
    <tr>
      <td>v0.28.0</td>
      <td><strong>Added:</strong> <code>warehouse</code> source type, for destinations connected to a Reverse ETL source. Set <code>connection_mode.warehouse: cloud</code> for such a destination, or <code>apply</code> removes the entry.</td>
    </tr>
  </tbody>
</table>

For changes across every destination type, see [Destination Type Changes by Release](https://www.rudderstack.com/docs/rudder-cli/destination-types/changes/).

## See more

- [Webhook Destination](https://www.rudderstack.com/docs/destinations/webhooks/setup-guide/) for dynamic headers, dynamic paths, and transformation examples
- [HTTP Webhook Destination Config Reference](https://www.rudderstack.com/docs/rudder-cli/destination-types/http-webhook/) for the destination with request mapping and authentication modes
- [Destination Type Reference for Rudder CLI](https://www.rudderstack.com/docs/rudder-cli/destination-types/) for the rules shared across destination types

