# Webhook Destination Config Reference

<p><a href="https://www.rudderstack.com/docs/destinations/webhooks/setup-guide/" >Webhook</a> sends each event, unmodified, to an endpoint you own. For request mapping, authentication modes, or batching, use <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/http-webhook/" >HTTP Webhook</a> instead.</p>
<p>In a Webhook destination spec:</p>
<ul>
<li><code>type: webhook</code></li>
<li><code>definition_version: 1</code></li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="sample-configuration">Sample configuration</h2><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">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: &#34;{{ .WEBHOOK_SIGNING_KEY }}&#34;
      - from: X-Environment
        to: &#34;{{ .WEBHOOK_ENVIRONMENT }}&#34;

    connection_mode:
      web: cloud
      cloud: cloud
    consent_management:
      web:
        - provider: oneTrust
          consents:
            - analytics</code></pre></div>
</div>
<p>The above example sets two custom headers, and supplies both values through variables because every header value is a secret — see <a href="#headers" >Headers</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="config-keys">Config keys</h2><p><code>config</code> accepts only the keys listed below. The <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/#config-key-rules" >shared config key rules</a> cover unknown keys, defaults, and immutability.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="endpoint">Endpoint</h3><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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="headers">Headers</h3>
<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text"><p>In this destination, <code>from</code> is the header <strong>name</strong> and <code>to</code> is its <strong>value</strong>. That&rsquo;s the reverse of <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/http-webhook/#headers" >HTTP Webhook&rsquo;s <code>headers</code></a>, where <code>to</code> is the name.</p>
<p>Swapping them doesn&rsquo;t fail validation — it sends a header named after your value.</p>
</div>
  </div>
</blockquote>
<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. Values that aren&rsquo;t strings are stringified before they&rsquo;re set.
</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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="per-source-keys">Per-source keys</h3><p>Both keys are objects keyed by the local source type — the tokens listed under <a href="#source-types" >Source types</a>. A key naming a source type this destination doesn&rsquo;t support fails validation.</p>
<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/dev-tools/rudder-cli/destination-types/#consent-management" >Consent management</a>.
</p>

</div>

</div>

<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="source-types">Source types</h2><p>Webhook accepts events from these source types in the mentioned connection modes:</p>
<table>
<thead>
<tr>
<th>Source type</th>
<th>Connection mode</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>android</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>android_kotlin</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>ios</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>ios_swift</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>web</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>unity</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>cloud</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>react_native</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>flutter</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>cordova</code></td>
<td><code>cloud</code></td>
</tr>
</tbody>
</table>
<p>Every source type is <code>cloud</code> only — events reach the endpoint from RudderStack&rsquo;s servers, never in device mode.</p>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">The dashboard additionally offers Webhook to AMP, Shopify, and Reverse ETL sources. Rudder CLI doesn&rsquo;t manage those connections, so <code>amp</code>, <code>shopify</code>, and <code>warehouse</code> are invalid here.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="connect-a-source">Connect a source</h2><p>An event stream connection to this destination is checked against two rules at <code>validate</code> time.</p>
<p><strong>The source&rsquo;s type must be supported.</strong> A source&rsquo;s type resolves to one of the tokens above before the check — a JavaScript source resolves to <code>web</code>, and webhook and server-side SDK sources resolve to <code>cloud</code>. An unsupported type reports:</p>
<div class="rs-code">
  <div class="rs-code__head"><button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-text" data-lang="text">destination &#39;events-webhook-prod&#39; (type &#39;webhook&#39;) does not support source &#39;my-source&#39;:
source type &#39;amp&#39; is not among supported source types: android, android_kotlin, ...</code></pre></div>
</div>
<p><strong>The destination config must carry a <code>connection_mode</code> entry for that source type.</strong> This lives on the destination spec, not on the <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/yaml-connections/" >connection spec</a>. Without it:</p>
<div class="rs-code">
  <div class="rs-code__head"><button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-text" data-lang="text">destination &#39;events-webhook-prod&#39; config has no &#39;connection_mode&#39; entry for source type &#39;web&#39;</code></pre></div>
</div>
<p>Webhook needs no additional config keys to connect a source of any type.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="secrets">Secrets</h2><p>Every <code>headers</code> entry&rsquo;s <code>to</code> value — the header value — is secret. Write each as a <code>{{ .VAR }}</code> reference and supply the value at apply time:</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">config:
  headers:
    - from: X-Signing-Key
      to: &#34;{{ .WEBHOOK_SIGNING_KEY }}&#34;</code></pre></div>
</div>
<div class="rs-code">
  <div class="rs-code__head">bash<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">export RUDDER_WEBHOOK_SIGNING_KEY=&#34;...&#34;
rudder-cli apply

# or
rudder-cli apply --var-file secrets.vars.yaml</code></pre></div>
</div>
<p>Note that:</p>
<ul>
<li>Header values are masked as a group, so even a constant like <code>application/json</code> is treated as a secret.</li>
<li>The YAML that <code>rudder-cli import</code> writes may or may not include secret keys. Before you apply, make sure every secret key your configuration needs is present and populated through variable substitution.</li>
<li>Header names (<code>from</code>) aren&rsquo;t secret and are imported as-is.</li>
</ul>
<p>See <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/variable-substitution/" >How to Use Variable Substitution in Rudder CLI</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="see-more">See more</h2><ul>
<li><a href="https://www.rudderstack.com/docs/destinations/webhooks/setup-guide/" >Webhook Destination</a> for dynamic headers, dynamic paths, and transformation examples</li>
<li><a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/http-webhook/" >HTTP Webhook Destination Config Reference</a> for the destination with request mapping and authentication modes</li>
<li><a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/" >Destination Type Reference for Rudder CLI</a> for the rules shared across destination types</li>
</ul>

