Claim a pending invite
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.
/api/user/invites/{id}/acceptAtomic 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.
Path Parameters
Invite id (cuid)
Response Body
application/json
curl -X POST "https://loading/api/user/invites/string/accept"{
"organizationId": "org_partner",
"organizationName": "Partner Corp"
}List pending invites addressed to the caller's email GET
Lazy expiry — past-TTL rows are filtered out and status-flipped to `EXPIRED` in the background. The daily cron hard-deletes past-TTL rows overnight; this keeps the schema clean between runs without an extra scheduled job.
Decline a pending invite POST
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.