Webhooks
AppDNA sends HTTP POST requests to your server when events occur in your app. Webhooks let you sync data to your backend, trigger workflows, update CRMs, feed events into data warehouses, or power any custom integration.Overview
When you create a webhook endpoint in the AppDNA dashboard, you choose which event types to subscribe to. When a matching event occurs, AppDNA delivers a signed JSON payload to your endpoint URL via HTTP POST. Every delivery includes an HMAC-SHA256 signature so you can verify the payload originated from AppDNA and was not tampered with.Setup
Add an endpoint
Click Create Endpoint and enter your HTTPS URL. Non-HTTPS URLs are not supported in production.
Select event types
Choose which event types this endpoint should receive. You can select individual events or subscribe to all events.
Event Types
AppDNA supports 16 webhook event types organized into four categories:Billing
| Event | Description |
|---|---|
subscription.created | A new subscription was created |
subscription.renewed | An existing subscription renewed successfully |
subscription.cancelled | A subscription was cancelled (may still be active until period end) |
subscription.expired | A subscription period ended without renewal |
trial.started | A free trial began |
trial.converted | A trial converted to a paid subscription |
trial.expired | A trial ended without converting |
refund.processed | A refund was processed for a transaction |
Onboarding
| Event | Description |
|---|---|
onboarding.completed | A user completed an onboarding flow |
onboarding.skipped | A user skipped or dismissed an onboarding flow |
Engagement
| Event | Description |
|---|---|
survey.completed | A user submitted a survey response |
experiment.exposure | A user was exposed to an experiment variant |
push.delivered | A push notification was delivered to a device |
push.opened | A user opened a push notification |
System
| Event | Description |
|---|---|
paywall.impression | A paywall was displayed to a user |
config.updated | A config bundle was regenerated (new version published) |
Payload Structure
Every webhook payload follows a consistent structure:| Field | Type | Description |
|---|---|---|
id | string | Unique event ID. Use this for idempotency. |
type | string | The event type (e.g., subscription.created). |
timestamp | string | ISO 8601 timestamp of when the event occurred. |
data | object | Event-specific payload. Contents vary by event type. |
The
data object contents vary by event type. Refer to the specific event type documentation in the dashboard for the full schema of each event.Signature Verification
Every webhook request includes anx-appdna-signature header containing an HMAC-SHA256 signature of the raw request body. Always verify this signature before processing the payload.
The signature is computed as:
sha256=:
Verification Examples
- Node.js
- Python
- Ruby
Retry Policy
If your endpoint returns a non-2xx status code or does not respond within 15 seconds, AppDNA retries the delivery with exponential backoff:| Attempt | Delay After Failure |
|---|---|
| 1 | 30 seconds |
| 2 | 2 minutes |
| 3 | 10 minutes |
| 4 | 1 hour |
| 5 | 4 hours |
Best Practices
-
Respond with 2xx quickly. Return a
200 OKas soon as you receive the payload. Process the event asynchronously in a background job or queue. If your endpoint takes too long to respond, the delivery will be marked as failed and retried. -
Verify signatures on every request. Never process a webhook payload without verifying the
x-appdna-signatureheader. This protects you from forged requests. -
Handle idempotency. Webhook deliveries can be retried, which means your endpoint may receive the same event more than once. Use the
idfield to deduplicate events. Store processed event IDs and skip duplicates. - Use HTTPS. AppDNA only delivers webhooks to HTTPS endpoints in production. During development, you can use a tunneling tool like ngrok to expose a local endpoint.
- Monitor delivery health. Check the webhook delivery logs in the dashboard periodically. If you see a pattern of failures, investigate your endpoint’s availability and response times.
To test webhooks locally during development, use a tunneling tool like ngrok and point your webhook endpoint to the tunnel URL. Sandbox webhooks (
adn_test_ environment) are fully functional and isolated from production.