Headers and authentication

Headers and authentication

The HTTP Headers table on the webhook form sets static headers attached to every delivery. Both keys and values support {{ … }} placeholders. The most common use is authenticating to the receiver — a static Authorization header is the standard pattern.


Add a header

On the webhook form: URL Configuration → HTTP Headers → Add header.

Fill the two columns:

Column

Example

Column

Example

Key

Authorization

Value

Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6Ik…

Save. Every subsequent delivery sends that header.


Common patterns

Bearer token

Key

Value

Key

Value

Authorization

Bearer <token>

Used by GitHub, OpenAI, most modern APIs. Token belongs to the receiver service; manage rotation on that side.

Basic auth

Key

Value

Key

Value

Authorization

Basic <base64(username:password)>

Pre-compute the base64 yourself:

printf 'alice:s3cret' | base64

API key in a custom header

Key

Value

Key

Value

X-API-Key

<key>

Common with Datadog, PagerDuty, AWS API Gateway custom auth.

Content type other than JSON

Key

Value

Key

Value

Content-Type

application/x-www-form-urlencoded

Combined with a Custom JSON template that produces a form-encoded string. Most receivers expect JSON; only override when the receiver explicitly requires it.

Per-event header from the issue

Key

Value

Key

Value

X-Issue-Key

{{issue.key}}

X-Project

{{issue.project.key}}

X-Event

{{event}}

Useful when the receiver routes on header values.

Templated header key

The key column also supports {{ … }}:

Key

Value

Key

Value

X-Issue-{{issue.key}}

1

Niche but supported. Most receivers have a fixed schema and expect a static key — only use this when the receiver is explicitly designed to read dynamic header names.


Headers Webhooks Pro adds automatically

Header

When

Header

When

Content-Type: application/json

If you don't set one yourself, defaults to JSON for POST/PUT/PATCH deliveries.

Content-Length

Always — the platform sets this from the request body.

X-Webhook-Signature: sha256=<hex>

Only when an HMAC signing secret is configured on the webhook. See HMAC signing and secrets.

User-Agent

Atlassian Forge runtime sets a generic User-Agent — receivers shouldn't depend on its exact value.

If you set Content-Type yourself, your value wins.


Authentication: which to use

Receiver

Recommended

Receiver

Recommended

Slack incoming webhook URL

None — the URL itself is the secret. Add Content-Type: application/json if Slack rejects without it.

GitHub webhook target (your service)

Authorization: Bearer <…> and HMAC signing — defense in depth.

Internal Lambda behind API Gateway

X-API-Key: <…> set on API Gateway, plus IP allow-list if AWS-only.

Generic HTTPS endpoint you control

HMAC signing plus any of the above as belt-and-braces.

Basic-auth Jenkins / Confluence webhook

Authorization: Basic <base64(user:token)>

Microsoft Teams incoming webhook

None — same as Slack, the URL is the secret.

PagerDuty Events API v2

Content-Type: application/json is the only required header; the routing key goes in the body.

HMAC is the strongest option because it proves not just identity but body integrity. Use it whenever the receiver supports it. See HMAC signing and secrets.


Storing secrets

Static header values (e.g., the bearer token) are stored alongside the webhook configuration. They are:

  • Not echoed in the UI after save. The form shows the value during edit; once saved, you have to re-enter it to change.

  • Sent to the destination on every delivery — so the destination has to be trusted with the value (that's what auth is for).

  • Not visible in the delivery log body — the log records the rendered request body, not the headers a third party would care about. Headers themselves are stored in the log row but only visible on the expanded view to the Jira admin who can see the configuration anyway.

Don't put a secret in a {{ … }} placeholder pulling from an issue field. Anything resolved from Jira data ends up in the delivery log. The literal value column on the headers row is the right place.


Cross-cutting limits

  • Header count — practical limit is the request size limit imposed by Forge / your receiver. Several dozen headers are fine; thousands are not.

  • Header value length — same. Don't try to fit a 1 MB blob in a header.

  • Reserved names — the platform reserves Host, Content-Length, and a few others. Setting them on the form has no effect; the platform always overrides.

  • Case — HTTP headers are case-insensitive. Use any case that's readable to you (Authorization vs authorization is the same thing on the wire).


Common mistakes

Mistake

Symptom

Fix

Mistake

Symptom

Fix

Forget Content-Type: application/json for receivers that require it

4xx with "invalid payload"

Add the header.

Put Authorization token in a placeholder

Token leaks into delivery log

Use the literal value column.

Two headers with the same key (case difference)

Receivers may take the first or the last; depends on stack

Use one header per logical name.

Use Bearer without space

Receivers reject as malformed

The value should be Bearer <token> with a space.

Hard-code a secret in source-controlled webhook export

Secret travels in the JSON

Webhooks Pro's Export intentionally excludes signing secrets. Static header values are included — review your export before sharing.


Related