Registration & v1 API
Resident auth, registration, and /api/v1 routes.
Overview
Resident-facing APIs live under /api/v1/* (preferred) and legacy /registration/*. Portal and mobile clients use JWT Bearer auth after login.
Deep runbook: docs/REGISTRATION_API.md.
Auth endpoints
| Method | Path | Description |
|---|---|---|
POST | /api/v1/auth/clerk-session | Exchange Clerk session → Core JWT |
POST | /registration/register | Master registration (atomic tenant/property/unit/user/device) |
POST | /registration/login | Email/password login → JWT |
GET | /api/v1/auth/me | Current user profile |
Master registration
POST /registration/register creates or finds Tenant, Property, VirtualNumber, Unit, User, and Device in one atomic, idempotent transaction. Duplicate detection:
| Entity | Match key |
|---|---|
| Tenant | Name (case-insensitive) |
| Property | Name + tenantId, or address |
| VirtualNumber | e164 (unique) |
| Unit | unitLabel + propertyId |
| User | Email (unique) |
Protected routes (JWT required)
| Prefix | Purpose |
|---|---|
/api/v1/users/* | Profile, preferences |
/access/* | Approve/deny entry requests |
/devices/* | Push token registration |
Response envelope
Newer v1 routes return:
{ "data": { "user": { "id": "…" } } }Related
Last verified: 2026-06-21 (commit 293c4a7)