Webhooks
Registering receivers, the event catalogue, token verification against the raw body, retries and reconciliation.
A webhook is how App Center tells you something changed. It is at-least-once and best-effort: retries are bounded, ordering is not guaranteed, and a receiver that has been offline must be able to catch up by pulling.
Managing registrations
These live under /appcenter/v3/app, scoped to your own application — no method accepts an application id. The platform registers its two first-party receivers at boot; every other application registers its own. The cap is 10 registrations per application.
/webhooksappcenter:serviceRegister a receiver. No credential is issued, stored or returned.
Request body
urlstringrequired- HTTPS receiver, ≤ 2048 characters, no embedded credentials, no redirect target. Plain HTTP is refused.
eventsstring[]required- At least one entry from the catalogue below, or
*for everything. Duplicates are collapsed. descriptionstring | null- Free text up to 200 characters, so an operator can tell two receivers apart.
{
"url": "https://retill.example.com/webhooks/appcenter",
"events": [
"user.updated",
"business.updated",
"subscription.created"
],
"description": "Production receiver"
}{
"success": true,
"data": {
"webhook": {
"id": 17,
"url": "https://retill.example.com/webhooks/appcenter",
"description": "Production receiver",
"events": [
"user.updated",
"business.updated"
],
"active": true,
"version": 1,
"consecutiveFailures": 0,
"lastDeliveryAt": null,
"lastSuccessAt": null,
"lastFailureAt": null,
"createdAt": "2026-06-02T08:31:55.000Z",
"updatedAt": "2026-06-02T08:31:55.000Z"
}
}
}There is no secret to store: every delivery is signed with a short-lived token minted by the platform's identity provider.
Failures to handle
- 409
webhook_limit_reached - Ten registrations already exist. Delete one rather than rotating the URL of a live receiver.
- 409
CONFLICT - That URL is already registered for this application.
- 422
VALIDATION_FAILED - An unknown event name, a non-HTTPS URL, or an empty
eventsarray.
- The subscription family is five separate names — there is no
subscription.updated. - Creating a webhook does not send a verification request. Call
/testto prove the receiver.
/webhooksappcenter:serviceEvery registration for this application. No credential is stored to return.
{
"success": true,
"data": {
"webhooks": [
{
"id": 17,
"url": "https://retill.example.com/webhooks/appcenter",
"description": "Production receiver",
"events": ["user.updated", "business.updated"],
"active": true,
"version": 4,
"consecutiveFailures": 0,
"lastDeliveryAt": "2026-11-08T10:14:02.000Z",
"lastSuccessAt": "2026-11-08T10:14:02.000Z",
"lastFailureAt": null,
"createdAt": "2026-06-02T08:31:55.000Z",
"updatedAt": "2026-10-21T13:02:11.000Z"
}
]
}
}- An application with no registrations gets
{ "success": true, "data": { "webhooks": [] } }. GET /webhooks/:webhookIdreturns the same object underwebhook.versionis the concurrency token you must send back onPATCH.
/webhooks/:webhookIdappcenter:serviceChange the URL, the subscription list or the enabled flag. Every field except version is optional.
Request body
versionintegerrequired- The
versionyou last read. Compare-and-swap: a stale value is refused, never merged. urlstring- New HTTPS receiver. Must be unique per application.
eventsstring[]- Replaces the whole list, it does not merge.
descriptionstring | null- Up to 200 characters;
""is stored asnull. activebooleanfalsepauses delivery without losing its history or the log.
{
"version": 4,
"active": false
}{
"success": false,
"error": {
"code": "VERSION_CONFLICT",
"message": "This webhook was changed by another request. Reload and try again."
}
}Identical shape for a stale version here and on any other versioned write.
Failures to handle
- 404
NOT_FOUND - No such webhook, or it belongs to another application — the two are deliberately indistinguishable.
- 409
VERSION_CONFLICT - Someone else wrote first. Re-read, re-apply your change, retry once.
- 422
VALIDATION_FAILED - An unknown key was sent — the schema is strict on purpose — or
versionis missing.
- A successful write bumps
version, so read the response rather than assumingversion + 1.
/webhooks/:webhookIdappcenter:serviceRemove a registration and stop all future deliveries to it.
{
"success": true,
"data": {}
}Past deliveries stay readable through the redeliver route until they age out.
Failures to handle
- 404
NOT_FOUND - No such webhook for this application.
/webhooks/:webhookId/testappcenter:serviceQueue a ping delivery and return its delivery row, so a receiver can be proven end to end.
{
"success": true,
"data": {
"deliveryId": "5e1b0f0e-8a0a-4b2b-9f00-1c2c7a3e9d41",
"delivery": {
"id": "5e1b0f0e-8a0a-4b2b-9f00-1c2c7a3e9d41",
"webhookId": 17,
"event": "ping",
"status": "pending",
"attempts": 0,
"responseStatus": null,
"responseBody": null,
"error": null,
"deliveredAt": null,
"createdAt": "2026-11-08T10:40:12.000Z"
}
}
}It starts pending: the answer arrives later, through the delivery log.
pingcannot be subscribed to — only this route emits it — but a*registration still receives it.- With the job queue disabled in local development the row stays
pendingforever. That is the queue, not the receiver.
/webhooks/:webhookId/deliveriesappcenter:serviceThe delivery log, newest first: what was sent, how many attempts, and what came back.
Query parameters
limitinteger 1–100 · default 50- Page size.
cursorstring- The
nextCursorfrom the previous page, passed back verbatim. Keyset, not offset.
{
"success": true,
"data": {
"deliveries": [
{
"id": "5e1b0f0e-8a0a-4b2b-9f00-1c2c7a3e9d41",
"webhookId": 17,
"event": "ping",
"status": "delivered",
"attempts": 1,
"responseStatus": 204,
"responseBody": "",
"error": null,
"deliveredAt": "2026-11-08T10:40:13.412Z",
"createdAt": "2026-11-08T10:40:12.000Z"
}
],
"nextCursor": null
}
}nextCursor is null on the last page — the only stop condition.
Failures to handle
- 404
NOT_FOUND - No such webhook for this application.
- 422
VALIDATION_FAILED limitoutside 1–100, or a malformed cursor.
statusispending,deliveredorexhausted— the last means all seven attempts failed.responseBodyis your receiver's own reply, truncated to 2048 bytes before storage.
/webhooks/deliveries/:deliveryId/redeliverappcenter:serviceReplay a stored payload to its receiver. The replay is a new delivery, with a new id.
Parameters
deliveryIdstring · uuidrequired- The
idof the delivery to replay.
{
"success": true,
"data": {
"delivery": {
"id": "a72c4b19-2f55-4d6e-8c17-90b1e5f2aa38",
"webhookId": 17,
"event": "user.updated",
"status": "pending",
"attempts": 0,
"responseStatus": null,
"responseBody": null,
"error": null,
"deliveredAt": null,
"createdAt": "2026-11-08T11:02:44.000Z"
}
}
}id differs from the delivery you replayed — deduplicate on it, not on the payload contents.
Failures to handle
- 404
NOT_FOUND - The delivery does not exist, or belongs to another application.
- 422
VALIDATION_FAILED deliveryIdis not a uuid.
The request
Content-Type- Value
application/json User-Agent- Value
AppCenter-Webhooks/1 X-AppCenter-Event- ValueThe event name you subscribed to
X-AppCenter-Delivery- ValueDelivery uuid, also
body.id, and the token'sjti. Deduplicate on this X-AppCenter-Signature- Value
v2=followed by an RS256 JWT whosebody_sha256covers the raw body
Verify the token
The signature is a JWT minted per attempt by the platform's identity provider, signed with the same keys that sign access tokens. Verify it against <issuer>/jwks; there is no shared secret to provision or rotate. Three claims bind it to the delivery: jti must equal X-AppCenter-Delivery, evt must equal X-AppCenter-Event, and body_sha256 must equal the base64url SHA-256 of the raw body. exp is five minutes after the attempt, so a retry carries a fresh token rather than a stale one.
import { createHash } from "node:crypto";
import { createRemoteJWKSet, jwtVerify } from "jose";
const ISSUER = process.env.APPCENTER_ISSUER!; // https://api.example.com/oidc
const jwks = createRemoteJWKSet(new URL(`${ISSUER}/jwks`));
export async function POST(request: Request) {
// The token binds the bytes on the wire, so read the raw body first.
const rawBody = await request.text();
const signature = request.headers.get("x-appcenter-signature") ?? "";
let payload: Record<string, any>;
try {
({ payload } = await jwtVerify(signature.replace(/^v2=/, ""), jwks, {
issuer: ISSUER,
algorithms: ["RS256"],
}));
} catch {
return new Response("bad signature", { status: 401 });
}
if (payload.jti !== request.headers.get("x-appcenter-delivery")) {
return new Response("wrong delivery", { status: 401 });
}
const digest = createHash("sha256")
.update(rawBody, "utf8")
.digest("base64url");
if (payload.body_sha256 !== digest) {
return new Response("body mismatch", { status: 401 });
}
// Acknowledge first, work afterwards.
const body = JSON.parse(rawBody);
void enqueue(body);
return new Response(null, { status: 204 });
}import base64
import hashlib
import os
import jwt
from flask import Flask, abort, request
from jwt import PyJWKClient
app = Flask(__name__)
ISSUER = os.environ["APPCENTER_ISSUER"] # https://api.example.com/oidc
jwks = PyJWKClient(f"{ISSUER}/jwks")
@app.post("/webhooks/appcenter")
def receive():
# The token binds the bytes on the wire: read them before parsing.
raw = request.get_data()
signature = request.headers.get("X-AppCenter-Signature", "")
token = signature.removeprefix("v2=")
try:
key = jwks.get_signing_key_from_jwt(token)
claims = jwt.decode(
token,
key.key,
algorithms=["RS256"],
issuer=ISSUER,
options={"require": ["exp", "jti"]},
)
except jwt.PyJWTError:
abort(401)
if claims["jti"] != request.headers.get("X-AppCenter-Delivery"):
abort(401)
digest = base64.urlsafe_b64encode(hashlib.sha256(raw).digest())
if claims["body_sha256"] != digest.rstrip(b"=").decode():
abort(401)
# Acknowledge first, work afterwards.
enqueue(request.get_json())
return "", 204Digest the raw bytes, not the parsed object
Re-serialising the payload changes the bytes, so the digest can never match. If your framework parses JSON before your handler runs, capture the raw bytes in a middleware or use a body parser that preserves them.
The payload
Every delivery is one envelope: id, event, occurredAt, the application that produced it, and a data object whose inner shape depends on the event. The envelope is frozen when the delivery row is created, so a retry replays the same bytes — that is what makes the signature verifiable and the payload safe to deduplicate.
{
"id": "5e1b0f0e-8a0a-4b2b-9f00-1c2c7a3e9d41",
"event": "user.updated",
"occurredAt": "2026-11-08T10:14:02.000Z",
"app": { "id": 3, "shortCode": "VPOS" },
"data": {
"user": {
"useruuid": "0d5a…",
"email": "ama@example.com",
"firstname": "Ama",
"lastname": "Mensah",
"profileimage": "https://cdn.versified.com.gh/a/0d5a….jpg"
}
}
}{
"id": "0c8f2a51-3d77-4a19-b5e2-71f0c9d84b06",
"event": "business.updated",
"occurredAt": "2026-11-08T10:19:44.000Z",
"app": { "id": 3, "shortCode": "VPOS" },
"data": {
"accountUuid": "7f31…",
"business": {
"name": "Ama's Mart",
"email": "hello@amasmart.gh",
"phone": "+233 24 000 0000",
"address": "12 Oxford Street, Osu, Accra",
"profileImage": "https://cdn.versified.com.gh/b/7f31….png"
}
}
}{
"id": "8b41d2c6-6e0a-4f31-9a4d-2f5c1b7e8033",
"event": "subscription.created",
"occurredAt": "2026-11-08T09:00:00.000Z",
"app": { "id": 3, "shortCode": "VPOS" },
"data": {
"subscription": {
"id": 412,
"planCode": null,
"accessTier": "pro",
"planId": 6,
"startDate": "2026-11-08T00:00:00.000Z",
"endDate": "2026-12-08T00:00:00.000Z"
}
}
}{
"id": "19f7c0be-52a1-4c8e-8d0c-6a3b9e14f7d2",
"event": "app.published",
"occurredAt": "2026-11-08T08:42:10.000Z",
"app": { "id": 3, "shortCode": "VPOS" },
"data": {
"application": {
"id": 3,
"shortCode": "VPOS",
"name": "Retill",
"status": "published",
"version": 12
}
}
}{
"id": "5e1b0f0e-8a0a-4b2b-9f00-1c2c7a3e9d41",
"event": "ping",
"occurredAt": "2026-11-08T10:40:12.000Z",
"app": { "id": 3, "shortCode": "VPOS" },
"data": { "message": "App Center webhook test delivery" }
}The event payload is thinner than the REST read
A subscription.* event carries planId, the legacy accessTier label and the dates — planCode is always null. Read GET /app/subscriptions/:accountUuid when you need plan identity by code; treat the event as the trigger, not the record.
The event catalogue
user.updated- Fires whenA person's name, email or avatar changed — including a change made in another application
- `data` carries
user business.updated- Fires whenAn account owner's business profile or logo changed
- `data` carries
accountUuid,business(nullable) subscription.created- Fires whenA plan was bought for this application
- `data` carries
subscription subscription.renewed- Fires whenA period rolled over without a plan change
- `data` carries
subscription subscription.plan_changed- Fires whenThe account moved to a different plan
- `data` carries
subscription subscription.cancelled- Fires whenAuto-renewal was stopped; the period still runs to
endDate - `data` carries
subscription subscription.expired- Fires when
endDatepassed without a renewal - `data` carries
subscription app.updated- Fires whenThe catalogue record changed — name, presentation, status
- `data` carries
application app.published- Fires whenThe application became visible in the catalogue
- `data` carries
application app.archived- Fires whenThe application was withdrawn from the catalogue
- `data` carries
application ping- Fires whenOnly from
POST /webhooks/:webhookId/test. Not subscribable, but a*registration receives it - `data` carries
message *- Fires whenNot an event — the subscription entry that means "all of the above"
- `data` carries—
Who receives which event
user.updatedandbusiness.updatedfan out to every application the person holds a subscription with — not just the one that changed.- A
subscription.*event goes only to the application the subscription belongs to, whether or not that application registered a receiver. app.*events concern the catalogue record itself and go to the application they describe.- No registration means no delivery. A missed event is recovered by pulling, never by re-pushing.
Retries
- Request timeout
- Value10 seconds; redirects are not followed
- Success
- ValueAny
2xx. A3xxis a failure - Attempts
- Value7 total, first retry after 60 s, exponential backoff capped at 6 h
- After that
- ValueThe delivery is marked
exhausted - Failure tracking
- Value
consecutiveFailures,lastFailureAt,lastSuccessAt— surfaced, never actioned
App Center does not disable a failing webhook. Ten consecutive failures still gets attempt eleven, which means a permanently dead receiver looks like a health problem rather than a switch. Answer fast and do the work asynchronously — a handler that takes longer than 10 seconds will be retried even though it succeeded.
Idempotency
- Deduplicate on
X-AppCenter-Delivery(equal tobody.id), with a TTL of a few days. - A retry keeps the same delivery id; a redelivery of old data gets a new one because it is a new event.
- Ordering is not guaranteed between different events. Compare
occurredAtand ignore a payload older than what you already hold. - Acknowledge before you process. If processing fails after the acknowledgement, reconcile by pulling.
Reconciliation
- 1
Compare in batches
Read
GET /users?uuids=…or?emails=…in batches of up to 100 and diff against your local rows. - 2
Re-read what you are unsure about
GET /subscriptions/:accountUuidresolves any doubt about entitlement. - 3
Replay rather than re-push
POST /webhooks/deliveries/:deliveryId/redeliveris the supported way to re-run one payload. Nothing re-pushes state on boot.
Local development
With SKIP_JOB_QUEUE=true App Center records the delivery row and logs a warning instead of starting a worker, so it stays pending forever. That is expected — start the queue, or call /webhooks/:id/test against a running worker.
Something here out of date or unclear?
The platform team answers integration questions directly.
