Select spec version:

Webhook Destination Config Reference

Complete Rudder CLI reference for the Webhook destination config keys, headers, source types, and secrets.
Available Plans
  • free
  • growth
  • enterprise

Webhook sends each event, unmodified, to an endpoint you own. For request mapping, authentication modes, or batching, use 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.

Config keys

config accepts only the keys listed below. The shared config key rules cover unknown keys, defaults, and immutability.

Endpoint

webhook_url

Required

Type: string

Description: Endpoint RudderStack sends events to.

Notes:

  • Must be a public domain URL: http or https, at least one dot-separated label followed by an alphabetic top-level domain, an optional port, and an optional path.
  • localhost addresses and <name>.ngrok.io addresses are rejected.
  • A {{ path || fallback }} template is accepted in place of a literal.
To change the path per event, use a transformation — see Add dynamic path to base URL.

webhook_method

Type: string

Default value: POST

Description: HTTP method of the outgoing request.

Notes:

  • One of POST, PUT, PATCH, GET, or DELETE.

Headers

In this destination, from is the header name and to is its value. That’s the reverse of HTTP Webhook’s headers, where to is the name.

Swapping them doesn’t fail validation — it sends a header named after your value.

headers

Type: array of objects

Description: Custom headers added to every request. Both fields are strings, so quote a number: to: "5". An unquoted number fails validation.

Notes:

  • from — header name, for example content-type.
  • to — header value, for example application/json. Secret — see Secrets.
  • Each is at most 1000 characters, and must not contain line breaks. A {{ path || fallback }} template is accepted in place of a literal.

RudderStack adds user-agent: RudderLabs and content-type: application/json to POST and PUT requests on its own.

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

To set a header from the event itself, use a transformation — see Add dynamic header to events.

Per-source keys

Both keys are objects keyed by the local source type — the tokens listed under Source types. A key naming a source type this destination doesn’t support fails validation.

connection_mode

Type: object

Description: Maps each source type you connect to the mode its events reach the endpoint in, using the modes in Source types.

Notes:

yaml
connection_mode:
  web: cloud
  cloud: cloud

Source types

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

Source typeConnection mode
androidcloud
android_kotlincloud
ioscloud
ios_swiftcloud
webcloud
unitycloud
cloudcloud
react_nativecloud
fluttercloud
cordovacloud
warehousecloud

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 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 — see Manage Reverse ETL Connections using Rudder CLI.

The dashboard additionally offers Webhook to AMP and Shopify sources. Rudder CLI doesn’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. Without it:

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.
  • Header names (from) aren’t secret and are imported as-is.

See How to Use Variable Substitution in Rudder CLI.

Changes by release

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

For changes across every destination type, see Destination Type Changes by Release.

See more

Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.