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
- Navigate to your application settings in the Developer Portal.
- Add a webhook endpoint URL (must be HTTPS).
- Select the events you want to subscribe to.
- Save and note the signing secret.
Organization Webhooks
An organization can also send events to its own endpoints, without an app:
- Go to the stemp Console and navigate to Settings → Webhooks.
- Add an endpoint URL (must start with
https://). - Select the events you want to subscribe to.
- 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"
}
}| Field | Description |
|---|---|
type | The event type (see Webhook Events) |
createdAt | When the event occurred (UTC) |
data | Event-specific payload |
installation | App webhooks only: the app installation the event belongs to |
Headers
| Header | Description |
|---|---|
Content-Type | application/json |
X-Webhook-Signature | Base64-encoded HMAC-SHA256 signature for verification |
X-Webhook-ID | Unique event ID, the same for every attempt |
X-Webhook-Timestamp | Unix timestamp (seconds) of the delivery attempt |
X-Webhook-Event-Type | The 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:
| Attempt | Delay |
|---|---|
| 1st attempt | Immediately |
| 2nd attempt | Up to 30 seconds later |
| 3rd attempt | About 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
200response quickly; process events asynchronously. - Use the
X-Webhook-IDheader to deduplicate events. - Always verify the webhook signature.
- Handle events idempotently — you may receive the same event more than once.