← Back to landing

API reference

Base URL, authentication, response format and endpoint groups.

API reference

The BizFlow API is a NestJS service behind the global prefix /api/v1. All routes below are relative to that prefix.

Base URL & authentication

text
https://<your-bizflow-host>/api/v1

Every request must include:

text
Authorization: Bearer <Clerk JWT>
x-organization-id: <active organization id>   (for multi-tenant routes)

Authentication is Clerk JWT bearer tokens. Role and permission checks run server-side with @Roles / @Permissions guards; tenant scope is enforced from the x-organization-id header.

Response envelope

Responses are wrapped:

json
{
  "success": true,
  "statusCode": 200,
  "message": "OK",
  "data": { }
}

Clients read data. Errors return success: false with a status code and message.

Health & monitoring

EndpointPurpose
GET /healthPublic health probe (database, Redis, Clerk, email, queues, heap) — not under /api/v1
GET /api/v1/metricsPrometheus metrics

People & tenancy

Endpoint groupNotes
/usersGET /users/me, GET /users, GET /users/all-users, POST /users, PUT/DELETE /users/:id
/organizationsCRUD + POST/GET /:id/users, PATCH/DELETE /:id/users/:userId
/tenantsCRUD + /:id/users, /:id/storage, /:id/plan-usage, PATCH /:id/plan
/subscription-plansGET /subscription-plans
/activity-logGET /, GET /entity/:type/:id

HR & attendance

Endpoint groupNotes
/employeesCRUD + /:id/qr-authorization, /:id/push-token, contact/personal/health-safety updates
/freelancersCRUD + /:id/reliable, /:id/convert, QR authorization
/traineesCRUD + /:id/reliable, /:id/periods, QR authorization
/leavesCRUD + /employee/:employeeId/used-days
/attendancecheck-in, check-out, break, records, bypass, location, callout, overtime, summary, day-off-overtime, bulk-past
/emergency-calloutsCRUD + leader/assistant responses, check-in/check-out
/payrollRuns + /calculate, /check, /draft, /history, /payments/:id, /email, revert
/performanceGET /unified, GET /me
/warningsCRUD
/departmentsCRUD + /detailed
/institutionsCRUD
/biometricsPOST /enroll, /verify, /test-verify

Financials

Endpoint groupNotes
/quotationsCRUD + /:id/pdf, /:id/convert, /:id/duplicate, /:id/send-email, /:id/cancel
/invoicesCRUD + /recurring, /:id/pdf, /:id/send-email, /:id/convert-to-credit-note
/invoice-documentsPOST /generate, /:id/email, /items/:id/tick
/paymentsPOST /expenses/:id, POST /invoices/:id, deletes for both
/expensesCRUD + /export, /recurring, /:id/attachments, /:id/payments
/transactionsCRUD
/transactions-ceoCEO dashboard ledger
/loans + /lendersCRUD + /loans/:id/payments
/banksCRUD
/refundsPOST /sale/:saleId, /:id/approve, /:id/reject, PUT /:id/notes

Sales & catalog

Endpoint groupNotes
/shop/productsCRUD + /brands, /stats, /export, /export-catalog, /:id/sales, /:id/documents
/shop/salesCRUD + /export, /send-receipt, /:id/create-order, /:id/stock-awaits
/shop/ordersCRUD + /export, /:id/receipt
/shop/quotationsCRUD + /:id/convert, /:id/transfer
/shop/customers, /shop/vendors, /shop/categories, /shop/documentsCRUD
/shop/stock-movementsCRUD + /export
/shop/stock-awaitsCRUD + /bulk-update, /:id/resolve
/products, /services, /coupons, /clientsCRUD
/package-categories, /packages, /subpackagesCRUD + duplicate/convert helpers

Projects & tasks

Endpoint groupNotes
/tasksCRUD + /:id/status, /:id/due-date, /:id/commencement, /:taskId/job-card
/subtasks, /task-types, /time-entriesCRUD
/projectsCRUD + /:id/members, /invoices/link, /:id/star
/work-logsCRUD
/comments, /documents, /folders, /notesCollaboration
/time-entries-mobile, /subtasks-mobileMobile task time + subtasks

Fleet & tools

Endpoint groupNotes
/fleet/vehiclesCRUD + /:id/media, /:id/qr, /:id/stats
/fleet/tripsCRUD + /stops, /:id/end, /:id/location, /:id/stops
/fleet/fuel, /fleet/expenses, /fleet/maintenance, /fleet/complianceCRUD
/fleet/vehicle-claims, /fleet/vehicle-instalments, /fleet/vehicle-licensingCRUD
/fleet/fleet-statsStats
/toolsCRUD + /:id/duplicate, /:id/interuse, /:id/maintenance, /:id/movements, /export
/worker-tools/allocate, /check, /return, /stats/*
/tool-rentalsCRUD + /:id/accept, /:id/damage
/tool-requests, /tool-checks, /tool-maintenanceCRUD

AI, notifications & utilities

Endpoint groupNotes
/ai-chatPOST /, POST /stream
/chat-sessionsCRUD
/aiPOST /tasks, POST /subtasks, POST /compose-job-card-email
/notificationsCRUD + /read-all, /:id/read
/uploadPOST /, POST /trip, POST /cleanup-email-attachments
/send-email, /send-custom-emailEmail sending
/generate-pdfServer-side PDF generation
/searchGlobal search
/sidebar/statsPending-count badges
/mobile/calendarUnified mobile calendar
/driver-tasksFleet driver tasks
/dashboardDashboard stats

Rate limits & errors

  • Throttling: 100 requests / 60 seconds per client by default.
  • Validation: unknown fields are rejected (whitelist + forbidNonWhitelisted).
  • Errors: 401 (unauthenticated), 403 (permission denied), 429 (rate limited), 500 (server error).