API Reference

265 endpoints across 25 route modules. Base URL: /v1/. All routes require JWT Bearer token unless marked Public. Tenant isolation via X-Tenant-ID header.

Common Headers

Authorization: Bearer <jwt_access_token>
X-Tenant-ID: <society_id>
X-Society-ID: <society_id>          // alias for X-Tenant-ID
X-Societee-Persona-ID: <persona_id>  // optional persona switch
Content-Type: application/json

Rate Limiting Tiers

TierLimitApplied To
AUTH10 req/min per IPLogin, register, MFA, password reset
READ120 req/min per userGET endpoints, list operations
WRITE30 req/min per userPOST/PUT/DELETE mutations
EXPORT5 req/min per userCSV/PDF generation, report exports
AI_QUERY10 req/min per userAI copilot, RAG queries

1. Authentication — auth.ts 23 endpoints

Public

MethodPathDescription
POST/auth/registerRegister new society + admin user
POST/auth/loginEmail/password login
POST/auth/refreshRefresh JWT pair (valid refresh token)
POST/auth/forgot-passwordSend password-reset email
POST/auth/reset-passwordSet new password via token

Authenticated

MethodPathDescription
POST/auth/logoutInvalidate session
POST/auth/change-passwordChange password (old + new)
POST/auth/mfa/setupGenerate TOTP secret + QR data URL
POST/auth/mfa/verifyVerify TOTP code during setup
POST/auth/mfa/loginMFA step in login flow (tempToken + code)
POST/auth/mfa/disableDisable MFA (requires password recheck)
GET/auth/mfa/statusCheck MFA enrollment
GET/auth/meCurrent user profile + permissions + roles
PATCH/auth/profileUpdate profile (name, phone, avatar)
POST/auth/switch-personaSwitch active persona/role context
POST/auth/dpdp/consentRecord DPDP data-usage consent
GET/auth/dpdp/consentFetch DPDP consent record
GET/auth/sessionsList active sessions
DELETE/auth/sessions/:sessionIdRevoke specific session
POST/auth/sessions/revoke-allRevoke all other sessions

RBAC Management

MethodPathDescription
GET/auth/rbac/rolesList system roles
POST/auth/rbac/rolesCreate custom role
PUT/auth/rbac/roles/:roleIdUpdate role permissions
DELETE/auth/rbac/roles/:roleIdDelete custom role
POST/auth/rbac/assignAssign role to user
POST/auth/rbac/revokeRevoke role from user
GET/auth/rbac/permissionsList all permission strings

2. Society Admin — admin.ts 11 endpoints

MethodPathDescription
GET/admin/profileGet society profile
PUT/admin/profileUpdate society profile (name, address, logo)
POST/admin/ai/tasksCreate AI task
GET/admin/ai/tasksList AI tasks (filter by status)
PUT/admin/ai/tasks/:taskIdUpdate AI task
DELETE/admin/ai/tasks/:taskIdDelete AI task
GET/admin/noticesList notices
POST/admin/noticesCreate notice
PUT/admin/notices/:noticeIdUpdate notice
DELETE/admin/notices/:noticeIdDelete notice
GET/admin/notices/:noticeIdGet single notice

3. Accounting & GST — accounting.ts 16 endpoints

MethodPathDescription
GET/accounting/chart-of-accountsList chart of accounts
POST/accounting/chart-of-accountsCreate account (code, name, type)
POST/accounting/journal-entriesCreate double-entry journal
GET/accounting/journal-entriesList journal entries (date range)
POST/accounting/bank-reconciliationReconcile bank statement (fuzzy match)
GET/accounting/gst-summaryGST liability summary (CGST/SGST/IGST)
POST/accounting/gst-returnsFile/prepare GST return
GET/accounting/tds-summaryTDS deduction summary
POST/accounting/credit-notesCreate credit note
POST/accounting/debit-notesCreate debit note
GET/accounting/trial-balanceTrial balance report
GET/accounting/profit-and-lossP&L statement
GET/accounting/balance-sheetBalance sheet
GET/accounting/cash-flowCash flow statement
GET/accounting/party-ledgerParty ledger (vendor/flat)
POST/accounting/tally/exportExport for Tally (XML/CSV)

4. Payments — payments.ts 7 endpoints

MethodPathDescription
POST/payments/recordRecord a payment
POST/payments/upi/qrGenerate UPI QR code
GET/payments/bank-accountsList bank accounts
POST/payments/bank-accountsAdd bank account
POST/payments/verifyVerify/confirm payment
POST/payments/refundInitiate refund
GET/payments/statsPayment statistics

5. Complaints — complaints.ts 6 endpoints

MethodPathDescription
GET/complaintsList complaints (filter: status, category, priority)
GET/complaints/myList current user's complaints
POST/complaintsCreate complaint
GET/complaints/:complaintIdGet complaint details
PUT/complaints/:complaintIdUpdate complaint
DELETE/complaints/:complaintIdDelete complaint

6. Community — community.ts 15 endpoints

MethodPathDescription
GET/community/pollsList polls
POST/community/pollsCreate poll
POST/community/polls/:pollId/voteCast vote
GET/community/polls/:pollId/resultsPoll results
GET/community/forumList forum threads
POST/community/forumCreate thread
GET/community/forum/:threadIdGet thread + replies
POST/community/forum/:threadId/replyReply to thread
GET/community/eventsList events
POST/community/eventsCreate event
POST/community/events/:eventId/rsvpRSVP (GOING/MAYBE/NOT_GOING)
GET/community/blood-donorsList blood donors
POST/community/blood-donorsRegister as blood donor
GET/community/safety-alertsList safety alerts
POST/community/safety-alertsCreate safety alert

7. Visitors — visitors.ts 8 endpoints

MethodPathDescription
GET/visitorsList visitor logs
POST/visitorsCreate visitor entry (check-in)
GET/visitors/activeList currently-in-premises visitors
GET/visitors/statsVisitor statistics
GET/visitors/:visitorIdGet visitor details
POST/visitors/:visitorId/check-outCheck out visitor
POST/visitors/:visitorId/approveApprove pre-approved visitor
POST/visitors/:visitorId/rejectReject visitor

8. Letters & NOC — letters.ts 9 endpoints

MethodPathDescription
GET/letters/templatesList letter templates
POST/letters/templatesCreate letter template
PUT/letters/templates/:templateIdUpdate template
DELETE/letters/templates/:templateIdDelete template
POST/letters/requestSubmit letter request
GET/letters/requestsList letter requests
POST/letters/requests/:requestId/approveApprove letter request
POST/letters/requests/:requestId/rejectReject letter request
GET/letters/requests/:requestId/generateGenerate letter PDF

9. Guard Operations — guard.ts 10 endpoints

MethodPathDescription
POST/guard/loginGuard badge-based login
POST/guard/shift/startStart shift
POST/guard/shift/endEnd shift
GET/guard/shift/currentGet current active shift
POST/guard/gate/entryLog vehicle/person entry
POST/guard/gate/exitLog vehicle/person exit
POST/guard/passcode/approveApprove visitor passcode
POST/guard/patrol/scanRecord patrol checkpoint scan
POST/guard/sosTrigger SOS alert
GET/guard/shift/event-logGet shift event log

10. AI Guard Agents — guardAgents.ts 6 endpoints

MethodPathDescription
POST/guard-agents/anpr/webhookANPR camera plate detection (service-to-service)
POST/guard-agents/face/webhookFace detection webhook (service-to-service)
POST/guard-agents/auto-checkoutAuto-checkout visitors >4hrs (cron)
POST/guard-agents/boom/barrierOpen/close boom barrier
GET/guard-agents/dashboardGuard AI dashboard (alerts, stats)
POST/guard-agents/sos/broadcastBroadcast SOS to all guards

11. Documents & Vault — documents.ts 14 endpoints

MethodPathDescription
GET/documentsList documents (vault)
POST/documentsUpload document (multipart)
GET/documents/:documentIdGet document + download URL
DELETE/documents/:documentIdDelete document
GET/documents/registers/membersMembers register
GET/documents/registers/minutesMinutes register
GET/documents/registers/resolutionsResolutions register
GET/documents/registers/meetingsMeetings register
GET/documents/registers/vehiclesVehicles register
GET/documents/letter-templatesList letter templates
POST/documents/letter-templatesCreate letter template
POST/documents/letter-requestsSubmit letter request
GET/documents/letter-requestsList letter requests
POST/documents/letter-requests/:requestId/approveApprove letter request

12. Vendor Management — vendors.ts 11 endpoints

MethodPathDescription
GET/vendorsList vendors
POST/vendorsCreate vendor
PUT/vendors/:vendorIdUpdate vendor
DELETE/vendors/:vendorIdDelete vendor
POST/vendors/:vendorId/rateRate vendor (1-5 stars)
GET/vendors/directoryPublic vendor directory
GET/vendors/:vendorId/billsList vendor bills
POST/vendors/:vendorId/billsCreate vendor bill
PUT/vendors/bills/:billIdUpdate bill
POST/vendors/bills/:billId/approveApprove bill
POST/vendors/bills/:billId/payMark bill as paid

13. Reports & Analytics — reports.ts 11 endpoints

MethodPathDescription
GET/reports/financial/summaryFinancial summary (income, expenses, balance)
GET/reports/financial/agingAccounts receivable aging (0-30-60-90+)
GET/reports/financial/trendsFinancial trends (monthly/quarterly)
GET/reports/financial/defaultersPayment defaulters list
GET/reports/operational/complaintsComplaint report by category
GET/reports/operational/visitorsVisitor report by purpose
GET/reports/operational/staffStaff attendance report
GET/reports/compliance/gstGST compliance report
GET/reports/compliance/tdsTDS compliance report
GET/reports/overview/dashboardOverview dashboard (all modules)
GET/reports/export/csvExport any report as CSV

14. AGM & Governance — agm.ts 13 endpoints

MethodPathDescription
GET/agm/meetingsList meetings
POST/agm/meetingsCreate AGM/EGM meeting
PUT/agm/meetings/:meetingIdUpdate meeting
DELETE/agm/meetings/:meetingIdCancel meeting
GET/agm/meetings/:meetingId/agendasList agendas
POST/agm/meetings/:meetingId/agendasAdd agenda item
GET/agm/meetings/:meetingId/resolutionsList resolutions
POST/agm/meetings/:meetingId/resolutionsCreate resolution
POST/agm/resolutions/:resolutionId/voteCast anonymous vote (Pedersen commitment)
GET/agm/meetings/:meetingId/minutesGet minutes
POST/agm/meetings/:meetingId/minutesSubmit minutes
GET/agm/meetings/:meetingId/quorumCalculate quorum
GET/agm/overviewGovernance overview

15. Resident Self-Service — resident.ts 12 endpoints

MethodPathDescription
GET/resident/dashboardResident dashboard (invoices, notices, complaints)
GET/resident/flatsList flats for current user
GET/resident/invoicesList user's invoices
GET/resident/invoices/:invoiceIdGet invoice detail + payments
POST/resident/paymentsRecord a payment
GET/resident/paymentsList payment history
GET/resident/receipts/:paymentIdGet payment receipt
POST/resident/pay/upiPay via UPI (QR code + deep link)
POST/resident/pay/advancePay advance deposit
GET/resident/ledgerLedger statement
GET/resident/vehiclesList user's vehicles
POST/resident/vehiclesRegister vehicle

16. Facilities — facilities.ts 7 endpoints

MethodPathDescription
GET/facilitiesList available facilities
GET/facilities/:facilityId/slotsCheck availability (date filter)
POST/facilities/bookingsCreate booking
GET/facilities/bookingsList my bookings
POST/facilities/bookings/:bookingId/cancelCancel booking
POST/facilities/escrow/holdHold security deposit
POST/facilities/escrow/releaseRelease escrow

17. Finance & Billing — finance.ts 10 endpoints

MethodPathDescription
GET/finance/invoicesList invoices (filter by status, flat)
POST/finance/invoicesCreate single invoice
POST/finance/invoices/generateBilling run (batch generate)
POST/finance/invoices/generate-runAutomated billing run
POST/finance/interest/accrueAccrue late-payment interest
GET/finance/receiptsList receipts
POST/finance/receiptsCreate receipt
GET/finance/payments/statsPayment statistics
GET/finance/ledgerSociety-wide ledger
POST/finance/accounting/journal-entriesCreate journal entry

18. Governance & Elections — governance.ts 14 endpoints

MethodPathDescription
GET/governance/electionsList elections
POST/governance/electionsCreate election
PUT/governance/elections/:electionIdUpdate election
POST/governance/elections/:electionId/voteCast vote (anonymous)
GET/governance/elections/:electionId/resultsElection results
GET/governance/meetingsList governance meetings
POST/governance/meetingsCreate meeting
GET/governance/meetings/:meetingId/minutesGet minutes
POST/governance/meetings/:meetingId/minutes/aiAI-generated MoM from transcript
POST/governance/meetings/:meetingId/minutes/transcribeTranscribe audio → minutes
GET/governance/nocList NOC requests
POST/governance/nocCreate NOC request
POST/governance/noc/:nocId/signSign NOC via Aadhaar eSign
GET/governance/audit-logsView audit logs

19. Security & Gate — security.ts 8 endpoints

MethodPathDescription
POST/security/pre-approvePre-approve visitor (TOTP-based)
POST/security/delivery/webhookDelivery partner webhook
POST/security/check-inCheck in visitor (guard)
POST/security/check-outCheck out visitor (guard)
GET/security/blacklistList blacklisted persons
POST/security/blacklistAdd to blacklist
DELETE/security/blacklist/:entryIdRemove from blacklist
POST/security/gate/syncSync gate status

20. ERP & Property Tree — erp.ts 12 endpoints

MethodPathDescription
GET/erp/buildingsList buildings
POST/erp/buildingsCreate building
GET/erp/buildings/:buildingId/wingsList wings
POST/erp/buildings/:buildingId/wingsCreate wing
GET/erp/wings/:wingId/flatsList flats
POST/erp/wings/:wingId/flatsCreate flat
PUT/erp/flats/:flatIdUpdate flat
POST/erp/residents/onboardOnboard resident to flat
POST/erp/residents/offboardOffboard resident from flat
GET/erp/nocList NOC requests
POST/erp/nocCreate NOC request
POST/erp/noc/:nocId/approveApprove NOC

21. Parking & EV — parking.ts 10 endpoints

MethodPathDescription
GET/parking/vehiclesList registered vehicles
POST/parking/vehiclesRegister vehicle
PUT/parking/vehicles/:vehicleIdUpdate vehicle
DELETE/parking/vehicles/:vehicleIdRemove vehicle
POST/parking/anpr/webhookANPR camera detection webhook
POST/parking/rfid/webhookRFID tag read webhook
GET/parking/visitorsList visitor parking
POST/parking/ev/sessionsStart EV charging session
POST/parking/ev/sessions/:sessionId/stopStop EV charging session
GET/parking/slots/availabilityCheck slot availability

22. Hyperlocal Marketplace — hyperlocal.ts 8 endpoints

MethodPathDescription
POST/hyperlocal/merchantsRegister as merchant
GET/hyperlocal/merchantsList merchants
GET/hyperlocal/marketplaceBrowse marketplace listings
POST/hyperlocal/marketplaceCreate listing
POST/hyperlocal/services/bookBook home service
GET/hyperlocal/services/bookingsList service bookings
POST/hyperlocal/dealsCreate merchant deal
GET/hyperlocal/dealsList active deals

23. Workforce — workforce.ts 6 endpoints

MethodPathDescription
GET/workforce/employeesList employees
POST/workforce/check-inGeo-fenced check-in
POST/workforce/check-outCheck out
GET/workforce/attendanceAttendance records
POST/workforce/checklistSubmit daily checklist
GET/workforce/checklistList checklists

24. Civic Escalation — civic.ts 5 endpoints

MethodPathDescription
POST/civic/complaints/escalateEscalate to municipal authority
GET/civic/complaintsList civic complaints
POST/civic/corporator/feedbackSubmit ward feedback
GET/civic/corporator/feedbackList feedback
POST/civic/cron/sla-monitorSLA monitoring cron trigger

25. AI Copilot & RAG — ai.ts 4 endpoints

MethodPathDescription
POST/ai/copilot/swarmDispatch query to AI agent swarm
POST/ai/rag/queryQuery RAG pipeline (Vectorize)
POST/ai/queue/eventIngress event to AI processing queue
GET/ai/copilot/historyRecent copilot query history

Endpoint Summary

ModuleRoute FileEndpoints
Authentication & RBACauth.ts23
Society Adminadmin.ts11
Accounting & GSTaccounting.ts16
Paymentspayments.ts7
Complaintscomplaints.ts6
Communitycommunity.ts15
Visitorsvisitors.ts8
Letters & NOCletters.ts9
Guard Operationsguard.ts10
AI Guard AgentsguardAgents.ts6
Documents & Vaultdocuments.ts14
Vendor Managementvendors.ts11
Reports & Analyticsreports.ts11
AGM & Governanceagm.ts13
Resident Self-Serviceresident.ts12
Facilitiesfacilities.ts7
Finance & Billingfinance.ts10
Governance & Electionsgovernance.ts14
Security & Gatesecurity.ts8
ERP & Property Treeerp.ts12
Parking & EVparking.ts10
Hyperlocal Marketplacehyperlocal.ts8
Workforceworkforce.ts6
Civic Escalationcivic.ts5
AI Copilot & RAGai.ts4
TOTAL25 files~265