---
title: "Error: invalid_signature"
status: current
phase: 7
---

# `invalid_signature`

**HTTP 401** · The signature is missing, stale or wrong.

## Why it happens

Something called an [inbound deploy hook](../api/webhooks.md#inbound-deploy-hooks) that has a **signing secret**. With a secret set, the URL alone isn't enough: every call must carry a valid `X-Ali-Signature` header, and this one didn't. One of:

- The header is missing (the sender doesn't sign, or signs with another header).
- `t` is more than 5 minutes away from Pluma's clock, so it looks like a replay.
- `v1` doesn't match: the secret in Pluma isn't the one the sender signs with, or the body changed on the way.

Nothing was built.

## How to fix it

- Copy the sender's signing secret again (in Ali, the `whsec_…` value of the webhook endpoint) and set it on the hook: **Settings → Deploy → Inbound deploy hooks**, `update_inbound_deploy_hook`, or `PATCH /api/v1/spaces/:space_id/inbound_deploy_hooks/:id` with `signing_secret`.
- If the sender can't sign, remove the secret (an empty `signing_secret`): the secret URL is then the only credential.

The signature is `X-Ali-Signature: t=<unix seconds>,v1=<hex>`, where `v1` is HMAC-SHA256 of `"<t>.<raw body>"` with the secret exactly as shown (the whole `whsec_…` string).

## Example

```json
{
  "error": {
    "code": "invalid_signature",
    "message": "The signature is missing, stale or wrong.",
    "fix": "This deploy hook has a signing secret, so every call must carry X-Ali-Signature: t=<unix>,v1=<HMAC-SHA256 of \"<t>.<body>\">, made less than 5 minutes ago with that same secret. Check the secret in both places, or remove it from the hook.",
    "doc_url": "https://pluma.so/docs/errors/invalid_signature"
  }
}
```
