Guides · Updated December 2, 2026

Where to find your Stripe webhook secret (whsec_)

Your webhook handler needs a value that starts with whsec_, usually stored as STRIPE_WEBHOOK_SECRET. Stripe calls it the endpoint's signing secret. It isn't on the API keys page, and you can't copy it from your secret key. Each webhook endpoint has its own, and Stripe shows it in three places depending on how the endpoint was created. This page is about getting the right one into your app. If you rotated or rolled secrets and events started failing, use Rotated your Stripe keys? Check your webhook secret instead.

The short answer

  1. In the Stripe Dashboard, open Workbench and go to the Webhooks tab.
  2. Make sure you're looking at the right mode: live for your production app, a sandbox or test mode for testing.
  3. Select the endpoint whose URL your app receives events on.
  4. Click Reveal secret and copy the whsec_… value (Stripe: Retrieving your endpoint's secret).

If the Webhooks tab has no endpoint, there's no secret to find yet. Stripe creates one when you add an endpoint: Create an event destination, choose the event types, choose Webhook endpoint, and enter your URL. The signing secret appears on the endpoint's settings page when you're done (Stripe: Create an event destination).

Webhook secret vs API keys

Stripe keeps these separate (Stripe: API keys):

Putting sk_… in STRIPE_WEBHOOK_SECRET, or a whsec_ in STRIPE_SECRET_KEY, is a common copy-paste mistake. Your handler then fails verification on every event.

Which secret your app needs

All of these start with whsec_, which is why they're easy to mix up:

Endpoints created with the API

For a webhook endpoint created with the v1 API, the secret field is only returned at creation (Stripe API: The Webhook Endpoint object). If you didn't save it, reveal it in Workbench. For the v2 Event Destinations API, Stripe's docs show adding webhook_endpoint.signing_secret to include when you create the destination; the response then contains the whsec_ value (Stripe: Create an event destination).

Where to put it

Check that your app has the right one

Don't print the whole secret. Log a few safe facts about it, send a test event, and compare the last four characters with the secret you revealed in Workbench:

// Temporary, in your webhook route. Remove it after you've compared. Never log the full secret.
const s = process.env.STRIPE_WEBHOOK_SECRET ?? "";
console.log({
  set: s.length > 0,
  startsWithWhsec: s.startsWith("whsec_"),
  hasStrayWhitespaceOrQuotes: s !== s.trim() || /^["']|["']$/.test(s),
  last4: s.slice(-4),
});

Stripe may also add optional debug entries to the Stripe-Signature header: secret is a redacted form of the endpoint's newest active signing secret, and destination is the ID of the endpoint it belongs to (we_… or ed_…). If they're present, they tell you which endpoint signed the request and whether its secret ends in the same characters as yours. Stripe says not to use them for verification; only a valid v1 signature authenticates a request (Stripe: Verify webhook signatures manually).

If the secret matches and verification still fails, the usual cause is a changed request body: Stripe needs the exact raw body, and frameworks that parse JSON before your handler break the signature (Stripe: Check the request body). If Stripe shows the event as Delivered but your app didn't change, the secret is fine and the problem is in the handler: see Stripe webhook not firing and paid but no access.

What PaidCheck's free report checks

PaidCheck can't see your environment variables or which whsec_ your server uses. With a read-only restricted key, the free report flags events from the last 30 days that Stripe hasn't delivered to an endpoint, disabled endpoints, endpoints missing subscription or checkout events, and a missing endpoint. Add a user list (CSV, Supabase function or HTTPS endpoint) to also see paying users who are locked out and canceled, unpaid or past_due users who still have access, which is what a wrong secret usually leads to. It never writes to Stripe or your app. Paid plans run these checks daily and send an alert email when a check finds a new issue.

FAQ

Where do I find my Stripe webhook secret?

In the Stripe Dashboard, open Workbench, go to the Webhooks tab, select the endpoint, and click Reveal secret (Stripe's docs also call it Click to reveal). The value starts with whsec_. Each endpoint has its own secret, so pick the endpoint whose URL your app actually receives events on.

Is the webhook secret the same as my Stripe secret key?

No. Stripe's docs say webhook signing secrets aren't API keys. API keys (sk_, rk_, pk_) authenticate requests your server makes to Stripe. The whsec_ signing secret lets your webhook handler check that a request really came from Stripe. You'll usually store it in its own variable, such as STRIPE_WEBHOOK_SECRET.

Why is my webhook secret different in test mode and live mode?

Stripe generates a unique secret for each endpoint, and if you use the same endpoint for test and live API keys the secret is different for each one. Your live deployment needs the live endpoint's secret.

Where is the secret when I test locally with the Stripe CLI?

stripe listen prints it when it starts ("Your webhook signing secret is whsec_..."). stripe listen --print-secret prints only the secret and exits. Stripe's docs say it doesn't change between restarts of the listen command. It's a different secret from any Dashboard endpoint, so don't deploy it to production.

I created the endpoint with the API. Can I fetch its secret again later?

For a webhook endpoint created with the v1 API, Stripe's API reference says the secret field is only returned at creation. If you didn't save it, open the endpoint in Workbench and reveal it there. With the v2 Event Destinations API, Stripe's docs show adding webhook_endpoint.signing_secret to include when you create the destination.

Can PaidCheck read my webhook secret?

No. PaidCheck reads Stripe through a read-only restricted key and never sees your server's environment variables or your whsec_ value. Its free report shows the effects of a broken webhook (events not delivered in the last 30 days, a disabled endpoint, missing event types, and with a user list, people whose access doesn't match Stripe). Paid plans run these checks daily and send an alert email when a check finds a new issue.

Check your own Stripe account for these issues. Run a free leak report →