Every RMZ webhook delivery is signed with HMAC-SHA256. Verifying the signature ensures the request genuinely came from RMZ and was not tampered with in transit.Documentation Index
Fetch the complete documentation index at: https://docs.rmz.gg/llms.txt
Use this file to discover all available pages before exploring further.
How signing works
- RMZ serializes the webhook payload to JSON
- The JSON string is signed using HMAC-SHA256 with your webhook’s secret key
- The resulting hex-encoded hash is sent in the
Signatureheader - Your server recomputes the hash and compares it to the header
Where to find your secret key
In the dashboard:- Go to الإعدادات → الويب هوك (Webhooks)
- Click معاينة on the webhook you want to verify
- The المفتاح السري للتوقيع (HMAC Signing Key) field shows the secret. Click the eye icon to reveal it, the copy icon to copy.
Verification steps
Get the raw request body
Read the raw body as a string. Do not parse to JSON first — the signature is computed on the exact bytes RMZ sent. Re-serializing changes whitespace and key ordering.
Compute the expected signature
Calculate
HMAC-SHA256(raw_body, secret_key) and hex-encode the result.Code examples
Common pitfalls
Why use the raw body, not parsed JSON?
Why use the raw body, not parsed JSON?
The signature is computed on the exact JSON string RMZ sends. If you parse and re-serialize it, whitespace and key ordering can change — producing a different hash and a false mismatch. Always verify against the raw request body.
My signature always fails — what's wrong?
My signature always fails — what's wrong?
Most common causes:
- You’re computing the hash on parsed JSON instead of the raw body
- Your framework strips trailing whitespace or BOM from the request body
- You copied the secret with leading/trailing whitespace
- You’re using the wrong webhook’s secret (each webhook has its own key)
- The webhook was rotated and you haven’t updated your server with the new key
Content-Length matches the actual body length, and log both the expected and received hashes during debugging (then remove the logs).How do I rotate the secret key?
How do I rotate the secret key?
In the dashboard:
- Open the webhook in معاينة mode
- Click the regenerate (↻) button next to the key
- Confirm — the old key stops working immediately
- Update your server’s
RMZ_WEBHOOK_SECRETenvironment variable with the new key - Redeploy
Are retries signed too?
Are retries signed too?
Yes. Every retry uses the current webhook secret. If you rotate the secret while a webhook is being retried, the next retry will be signed with the new key.
What about the X-RMZ-REQUEST-ID header?
What about the X-RMZ-REQUEST-ID header?
Use it for idempotency in your handler — if you receive two requests with the same
X-RMZ-REQUEST-ID, treat them as the same event. RMZ may retry on transient failures (5xx, network errors) up to the configured tries count.
