stemp Logostemp Developer

Webhooks

Receive real-time notifications when events occur on the stemp platform.

Webhooks

Webhooks allow your application to receive real-time HTTP callbacks when events occur on the stemp platform.

Setup

App Webhooks

  1. Navigate to your application settings in the Developer Portal.
  2. Add a webhook endpoint URL (must be HTTPS).
  3. Select the events you want to subscribe to.
  4. Save and note the signing secret.

Organization Webhooks

An organization can also send events to its own endpoints, without an app:

  1. Go to the stemp Console and navigate to Settings → Webhooks.
  2. Add an endpoint URL (must start with https://).
  3. Select the events you want to subscribe to.
  4. Copy the signing secret. It is only shown once.

Event Delivery

When an event occurs, stemp sends a POST request to your endpoint:

{
  "type": "stamp.added",
  "createdAt": "2026-11-01T10:30:00.123456Z",
  "data": {
    // Event-specific payload
  },
  "installation": {
    "id": "appi_abc123",
    "organizationId": "org_abc123",
    "organizationName": "Acme Coffee",
    "organizationSlug": "acme-coffee"
  }
}
FieldDescription
typeThe event type (see Webhook Events)
createdAtWhen the event occurred (UTC)
dataEvent-specific payload
installationApp webhooks only: the app installation the event belongs to

Headers

HeaderDescription
Content-Typeapplication/json
X-Webhook-SignatureBase64-encoded HMAC-SHA256 signature for verification
X-Webhook-IDUnique event ID, the same for every attempt
X-Webhook-TimestampUnix timestamp (seconds) of the delivery attempt
X-Webhook-Event-TypeThe event type

Signature Verification

Verify webhook authenticity by checking the signature. The signature is an HMAC-SHA256 of the raw request body, keyed with your signing secret exactly as shown to you (the full string; app secrets start with whsec_), and encoded as Base64:

import { createHmac, timingSafeEqual } from 'crypto'

function verifyWebhook(rawBody: string, signature: string, secret: string): boolean {
  const expected = Buffer.from(createHmac('sha256', secret).update(rawBody).digest('base64'))
  const received = Buffer.from(signature)
  return expected.length === received.length && timingSafeEqual(expected, received)
}

Always verify signatures before processing webhook payloads. Compute the signature over the raw body before parsing it as JSON. The timestamp header is not part of the signature.

Retry Logic

If your endpoint returns a 4xx or 5xx status code or cannot be reached, stemp retries delivery:

AttemptDelay
1st attemptImmediately
2nd attemptUp to 30 seconds later
3rd attemptAbout 30 seconds later

After 3 failed attempts, the delivery is marked as failed and is not retried automatically. Failed deliveries to organization webhooks can be retried in Settings → Webhooks.

An organization webhook endpoint is disabled after 10 failed deliveries within 24 hours.

Best Practices

  • Return a 200 response quickly; process events asynchronously.
  • Use the X-Webhook-ID header to deduplicate events.
  • Always verify the webhook signature.
  • Handle events idempotently — you may receive the same event more than once.