Skip to content

API Routes

MethodRoutePurpose
POST/api/auth/otp/sendSend 6-digit OTP to buyer email/WhatsApp
POST/api/auth/otp/verifyVerify OTP code, create session
POST/api/auth/logoutInvalidate buyer session
POST/api/auth/otp/resetReset OTP for re-verification
MethodRoutePurpose
GET/api/favoritesList buyer’s favorite units
POST/api/favoritesToggle unit favorite status
MethodRoutePurpose
GET/api/profileGet buyer profile
PATCH/api/profileUpdate buyer profile

Browser URLs use clean paths (e.g. /units, /leads) — the /admin/ prefix is a legacy internal detail; the middleware redirects /admin/* to clean paths.

MethodRoutePurpose
POST/api/auth/admin/otp/sendSend 6-digit OTP to CRM email
POST/api/auth/admin/otp/verifyVerify CRM OTP code, create Lucia session
POST/api/auth/admin/logoutInvalidate CRM session

Deprecated (to be removed):

MethodRoutePurpose
GET/accept?token=...Former magic-link token handler
MethodRoutePurpose
GET/api/admin/session/meCurrent admin user + accessible projects
POST/api/admin/session/active-projectSet active project for session
MethodRoutePurpose
GET/api/admin/leadsList leads with search and date filtering
GET/api/admin/leads/statsLead statistics (counts by project)
MethodRoutePurpose
GET/api/admin/unitsList units with status/category filters + pagination
POST/api/admin/unitsCreate new unit
GET/api/admin/units/[id]Get unit details
PATCH/api/admin/units/[id]Update unit
DELETE/api/admin/units/[id]Delete unit
GET/api/admin/units/[id]/imagesList unit images
POST/api/admin/units/[id]/imagesUpload/reorder unit images
MethodRoutePurpose
GET/api/admin/agentsList agents for current project
POST/api/admin/agentsCreate Makler profile + CRM user (crmRole, active project)
GET/api/admin/agents/[id]Get agent details + units
PATCH/api/admin/agents/[id]Update agent
DELETE/api/admin/agents/[id]Delete agent
MethodRoutePurpose
GET/api/admin/documentsList documents with category filter
POST/api/admin/documents/presignGenerate presigned upload URL for R2
MethodRoutePurpose
GET/api/admin/portal-settingsGet portal branding configuration
PATCH/api/admin/portal-settingsUpdate portal branding/features
GET/api/admin/portal-settings/logoGet logo upload URL
MethodRoutePurpose
GET/api/admin/domainsList domains for current project (also used by portal-settings UI)
POST/api/admin/domainsAdd new custom domain
DELETE/api/admin/domainsRemove domain (?hostname=)

CRM UI: domains card on Portal-Einstellungen; browser path /domains redirects to ?section=domains (internally rewrites to /admin/domains and /admin/portal-settings).

MethodRoutePurpose
POST/api/admin/inviteInvite CRM user — body: email, name, role, projectIds
POST/api/admin/invite-developerLegacy — email, name, projectIds (role forced to developer)
MethodRoutePurpose
GET/api/admin/maklerList organization members
POST/api/admin/maklerInvite developer member
PATCH/api/admin/makler/[id]Update member role
DELETE/api/admin/makler/[id]Remove member

Buyer-facing Proxy Routes (from portal subdomain)

Section titled “Buyer-facing Proxy Routes (from portal subdomain)”
MethodRoutePurpose
GET/api/proxy-public/configPublic portal config (no auth)
GET/api/proxy-public/unitsPublic unit listing with filters
GET/api/proxy-public/units/[id]Public unit detail (with agent info)
GET/api/proxy-public/contactGet contact info (phone, email)
POST/api/contactContact form submission