ruLog in to Senler

Signing secret

The secret lets the recipient verify request authenticity and integrity. Each project webhook has its own secret. It is not an API key and does not grant access to MCP or project actions.

Getting the secret

Open the webhook’s Settings tab. Under Signing secret, choose Generate. An existing webhook shows its current secret here; switching modes does not replace it.

  • The eye button shows or hides the value.
  • The copy button copies the secret for the recipient server.
Signing secret. Highlighted elements: 1. Generate; 2. shows or hides the value; 3. copies the secret; 4. Rotate secret
1. Generate · 2. shows or hides the value · 3. copies the secret · 4. Rotate secret

Store it only on the recipient server. Do not include it in page code, chats, or public logs.

Verifying requests

Senler sends a JSON POST. Verification depends on the format selected when creating the webhook. Both formats include Content-Type: application/json and X-Project-Id; project webhooks have no X-App-Id header.

Senler Webhook Standard

Signature headers:

  • X-Webhook-Event-Id: event ID matching event_id in the body;
  • X-Webhook-Timestamp: the current attempt time, matching timestamp in the body;
  • X-Webhook-Signature: hex-encoded HMAC-SHA256.

Signing uses this recipient's secret and the string v1.timestamp.event_id.canonicalJson(payload), where timestamp and event_id come from the request body. canonicalJson recursively sorts object keys, preserves array order, and adds no whitespace.

Use the signature verification example. For a project webhook, check X-Project-Id and the body's project_id against your allowed project instead of checking an application's Client ID. Also verify that the header and body IDs and timestamps match, that the timestamp is recent, that the signature is valid, and that the event type is allowed.

Standard Webhooks

This is the default for new HTTP webhooks. Use it with a recipient that supports Standard Webhooks. Senler sends:

  • webhook-id: event ID matching event_id in the body;
  • webhook-timestamp: attempt time in Unix seconds;
  • webhook-signature: v1,SIGNATURE, where the signature is Base64-encoded HMAC-SHA256.

To verify it, remove the whsec_ prefix from the secret, decode the remainder from Base64, and use the resulting bytes as the key. The signed string is webhook-id.webhook-timestamp.rawBody: rawBody is the exact received request body in UTF-8. Do not sort the JSON or rebuild it after parsing: even changing whitespace changes the signature.

Compare signatures using a constant-time comparison. Check the freshness of webhook-timestamp with a clock tolerance suitable for your service. After verifying the signature, validate project_id, X-Project-Id, and the allowed event_type. In this format, the body's timestamp keeps the original event time and does not have to match the attempt time in the header.

Event data and retries

The shared event reference describes body fields, allowed empty values, and data examples. Test delivery also includes test: true.

Retries keep the same event_id, but the attempt time in the header and the signature change. Senler Webhook Standard also updates the body's timestamp; Standard Webhooks keeps the body unchanged. Store processed IDs and do not perform the same action twice. Return 2xx after reliably accepting an event, including one already accepted.

Replacing the secret

If an external service issues the secret, obtain the new value from that service. Choose Specify and save it in the Recipient signing secret field in webhook settings. Generating a new secret only in Senler does not update the external service's key.

To generate a new secret in Senler for your own server:

  1. Select Rotate secret.
  2. In the confirmation dialog, select Rotate secret.
Signing secret. Highlighted elements: 1. confirmation dialog; 2. Rotate secret
1. confirmation dialog · 2. Rotate secret
  1. Immediately update the recipient server and send a test.

New requests use the new secret. Replacement affects only the selected webhook, not other recipients' secrets.