Skip to content

User-change webhooks

The signed events REM Auth sends your app when a person changes, is switched off or deleted, or changes teams - with signature verification.

Register with a webhook_url and the registration answer carries webhook_secret (whsec_..., the same on every re-registration; a super admin can show or rotate it under Products > your app > Events). REM Auth then POSTs one JSON event per change.

Event

When

data

user.updated

name, e-mail, e-mail verified, picture, username or active changed

user, changes, previous

user.deactivated

the account was switched off

user

user.deleted

the account was deleted

user as last seen

group.membership_changed

joined or left teams

user, added, removed

ping

Send a test event in the admin

message

user = {sub, username, email, email_verified, name, picture, is_active, groups, roles}. sub is the same sub your sign-in received. roles are your product's roles, empty while the e-mail is unverified.

Who hears: every product with a webhook address whose allowed teams the person is or was in (REM Super Admins always), or every product open to everyone.

Headers and signature

X-Rem-Event: user.updated
X-Rem-Event-Id: evt_...          the same id again = a retry or replay: handle it once
X-Rem-Timestamp: 1763400000      accept +-300 seconds
X-Rem-Signature: v1=<hex HMAC-SHA256(webhook_secret, "<timestamp>.<event id>." + raw body)>

Python:

import hashlib, hmac, time

def verify(body: bytes, headers, secret: str) -> bool:
    ts, eid = headers["X-Rem-Timestamp"], headers["X-Rem-Event-Id"]
    if abs(time.time() - int(ts)) > 300:
        return False
    mac = hmac.new(secret.encode(), f"{ts}.{eid}.".encode() + body, hashlib.sha256).hexdigest()
    sent = headers["X-Rem-Signature"].removeprefix("v1=")
    return hmac.compare_digest(mac, sent)

Ready-made: remauth_webhooks.verify(body, headers, secret) (Python), the webhook view of remauth_django.py, and verifyWebhook(body, headers, secret) from @rem/auth-react/server.

Delivery

Any 2xx is success. Otherwise REM Auth retries after 30 s, 2 min, 10 min, 1 h and 6 h; after the sixth attempt the event is a dead letter, listed under Products > your app > Events, where a super admin replays one or all (the event id stays the same).

What to do with each

  • user.updated: update your copy of name, e-mail, picture. If email_verified became false, stop trusting the e-mail and roles until it is true again.

  • user.deactivated, user.deleted: end the person's sessions in your app; remove or anonymise their data as your retention rules say.

  • group.membership_changed: re-read roles from the event (or at the next sign-in) and adjust permissions.

Last updated 18 Nov 2026

User-change webhooks · REM Platforms Blog