Decline a pending invite
Hard-delete (not a `DECLINED` status flip) — declined invites carry no audit value (admin-side list renders only PENDING rows) and the extra enum would buy nothing. If an admin still wants the user, they re-send.
/api/user/invites/{id}/declineHard-delete (not a DECLINED status flip) — declined invites carry no audit value (admin-side list renders only PENDING rows) and the extra enum would buy nothing. If an admin still wants the user, they re-send.
Path Parameters
Invite id (cuid)
Response Body
application/json
curl -X POST "https://loading/api/user/invites/string/decline"{
"ok": true
}Claim a pending invite POST
Atomic transaction — `Membership` create + invite `status → ACCEPTED` in one round-trip so a crash between writes can't leave a dangling PENDING row for someone who already has membership. Returns the org id + name so the client can navigate to it without a profile refetch.
Nightly database-hygiene sweep (Vercel Cron) GET
Bearer-authenticated. Vercel Cron invokes this endpoint per the schedule in `vercel.json` (currently `30 3 * * *` — 03:30 UTC). Six ordered steps in one run: (1) throwaway sessions below the `MIN_REAL_SESSION_*` floor, (2) expired invites, (3) sessions older than `SESSION_RETENTION_DAYS = 7`, (4) tracked users with zero remaining sessions, (5) organisations with zero memberships (after nullifying every `User.activeOrganizationId` that referenced them), (6) `VACUUM FULL` on the churned tables to return freed disk space to the OS. The `GET` verb is Vercel Cron's contract — destructive-on-GET is ugly but the alternative is a wrapper that fights the platform.