Base URL: /api
- Endpoint:
POST /api/auth/admin/login - Authentication: None (Public)
- Mandatory Fields:
email,password - JSON Body:
{
"email": "admin@example.com",
"password": "password123"
}- Response: Returns JWT token for admin authentication
- Endpoint:
GET /api/user - Authentication: None (Public)
- JSON Body: None
- Response: List of all users
- Endpoint:
POST /api/user - Authentication: Admin (Bearer Token Required)
- Mandatory Fields:
userName,email,role - JSON Body:
{
"userName": "John Doe",
"email": "john@example.com",
"amount": 5000000,
"role": "user",
"contact": "1234567890",
"estimatedInvestment": "50L",
"notes": "Premium customer"
}- Endpoint:
GET /api/user/admin/settings - Authentication: Admin (Bearer Token Required)
- JSON Body: None
- Endpoint:
PUT /api/user/admin/settings - Authentication: Admin (Bearer Token Required)
- Mandatory Fields:
email,companyName - JSON Body:
{
"email": "admin@shr.com",
"companyName": "Shr Homes"
}- Endpoint:
POST /api/user/admin/change-password - Authentication: Admin (Bearer Token Required)
- Mandatory Fields:
currentPassword,newPassword,confirmNewPassword - JSON Body:
{
"currentPassword": "oldPassword",
"newPassword": "newPassword",
"confirmNewPassword": "newPassword"
}- Endpoint:
GET /api/user/:userId - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
userId(UUID)
- Endpoint:
PUT /api/user/:userId - Authentication: Admin (Bearer Token Required)
- Mandatory Fields: None (Partial update)
- JSON Body:
{
"userName": "John Doe",
"email": "john.new@example.com",
"contact": "1122334455",
"estimatedInvestment": "60L",
"notes": "Updated notes"
}- URL Parameters:
userId(UUID)
- Endpoint:
DELETE /api/user/:userId - Authentication: Admin (Bearer Token Required)
- JSON Body: None
- URL Parameters:
userId(UUID)
- Endpoint:
POST /api/user/:userId/assign-supervisor - Authentication: Admin (Bearer Token Required)
- Mandatory Fields:
supervisorId - JSON Body:
{
"supervisorId": "uuid-of-supervisor"
}- URL Parameters:
userId(UUID)
- Endpoint:
DELETE /api/user/:userId/remove-supervisor - Authentication: Admin (Bearer Token Required)
- JSON Body: None
- URL Parameters:
userId(UUID)
- Endpoint:
GET /api/user/without-supervisor - Authentication: Admin (Bearer Token Required)
- JSON Body: None
- Endpoint:
GET /api/supervisor - Authentication: None (Public)
- JSON Body: None
- Endpoint:
POST /api/supervisor - Authentication: Admin (Bearer Token Required)
- Mandatory Fields:
fullName,email,phoneNumber,password,status - JSON Body:
{
"fullName": "Supervisor Name",
"email": "super@example.com",
"phoneNumber": "9988776655",
"password": "password123",
"status": "active"
}- Endpoint:
GET /api/supervisor/:supervisorId - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
supervisorId(UUID)
- Endpoint:
PUT /api/supervisor/:supervisorId - Authentication: Admin (Bearer Token Required)
- Mandatory Fields: None (Partial update)
- JSON Body:
{
"fullName": "New Name",
"status": "inactive"
}- URL Parameters:
supervisorId(UUID)
- Endpoint:
DELETE /api/supervisor/:supervisorId - Authentication: Admin (Bearer Token Required)
- JSON Body: None
- URL Parameters:
supervisorId(UUID)
- Endpoint:
POST /api/supervisor/:supervisorId/assign-project - Authentication: Admin (Bearer Token Required)
- Mandatory Fields:
projectId - JSON Body:
{
"projectId": "uuid-of-project"
}- URL Parameters:
supervisorId(UUID)
- Endpoint:
DELETE /api/supervisor/:supervisorId/remove-project - Authentication: Admin (Bearer Token Required)
- Mandatory Fields:
projectId - JSON Body:
{
"projectId": "uuid-of-project"
}- URL Parameters:
supervisorId(UUID)
- Endpoint:
POST /api/project/createproject - Authentication: Admin (Bearer Token Required)
- Mandatory Fields:
projectName,projectType,location,initialStatus,startDate,expectedCompletion,totalBudget,userId - JSON Body:
{
"projectName": "Luxury Villa",
"projectType": "Residential",
"location": "Hyderbad",
"initialStatus": "Planning",
"startDate": "2024-01-01",
"expectedCompletion": "2025-01-01",
"totalBudget": 5000000,
"userId": "uuid-of-user",
"materialName": "Cement",
"quantity": 100,
"notes": "Initial setup"
}- Endpoint:
PUT /api/project/updateproject/:projectId - Authentication: Admin (Bearer Token Required)
- Mandatory Fields: None (Partial update)
- JSON Body:
{
"projectName": "Luxury Villa Updated",
"totalBudget": 6000000
}- URL Parameters:
projectId(UUID)
- Endpoint:
DELETE /api/project/deleteproject/:projectId - Authentication: Admin (Bearer Token Required)
- JSON Body: None
- URL Parameters:
projectId(UUID)
- Endpoint:
GET /api/project/getproject/:projectId - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
projectId(UUID)
- Endpoint:
GET /api/project/getallprojects - Authentication: None (Public)
- JSON Body: None
- Endpoint:
GET /api/documents - Authentication: None (Public)
- Query Parameters:
documentType(optional),projectId(optional) - Example:
GET /api/documents?documentType=ARCHITECTURAL&projectId=uuid - JSON Body: None
- Endpoint:
POST /api/documents - Authentication: Admin (Bearer Token Required)
- Content-Type:
multipart/form-data - Mandatory Fields:
documentType,file - Form Data:
documentType: "Blueprint"description: "Main hall blueprint"projectId: "uuid"file: (File upload)
- Endpoint:
PUT /api/documents/:documentId - Authentication: Admin (Bearer Token Required)
- Content-Type:
multipart/form-data - Form Data:
description: "Updated description"file: (New file upload)
- URL Parameters:
documentId(UUID)
- Endpoint:
DELETE /api/documents/:documentId - Authentication: Admin (Bearer Token Required)
- JSON Body: None
- URL Parameters:
documentId(UUID)
- Endpoint:
GET /api/documents/:documentId/download - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
documentId(UUID)
- Endpoint:
POST /api/expense - Authentication: Admin/Supervisor (Bearer Token Required)
- Mandatory Fields:
projectId,category,amount,date - JSON Body:
{
"projectId": "uuid",
"category": "Labor",
"amount": 5000,
"date": "2024-02-01",
"description": "Daily wages"
}- Endpoint:
GET /api/expense - Authentication: None (Public)
- JSON Body: None
- Endpoint:
GET /api/expense/summary/all-projects - Authentication: None (Public)
- JSON Body: None
- Endpoint:
POST /api/material - Authentication: Admin/Supervisor (Bearer Token Required)
- Mandatory Fields:
projectId,materialName,quantity,date - JSON Body:
{
"projectId": "uuid",
"materialName": "Steel",
"quantity": 500,
"date": "2024-02-01",
"notes": "Grade A Steel"
}- Endpoint:
GET /api/material - Authentication: None (Public)
- JSON Body: None
- Endpoint:
GET /api/material/project/:projectId - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
projectId(UUID)
- Endpoint:
POST /api/payment/createpayment - Authentication: Admin (Bearer Token Required)
- Mandatory Fields:
amount,projectId,paymentStatus,paymentDate - JSON Body:
{
"amount": 25000,
"projectId": "uuid",
"paymentStatus": "pending",
"paymentDate": "2024-02-01",
"paymentType": "Standard",
"paymentMethod": "cash",
"remarks": "Advance payment"
}- Endpoint:
PUT /api/payment/updatepayment/:paymentId - Authentication: Admin (Bearer Token Required)
- Mandatory Fields: None (Partial update)
- JSON Body:
{
"paymentStatus": "completed",
"amount": 25000
}- URL Parameters:
paymentId(UUID)
- Endpoint:
DELETE /api/payment/deletepayment/:paymentId - Authentication: Admin (Bearer Token Required)
- JSON Body: None
- URL Parameters:
paymentId(UUID)
- Endpoint:
GET /api/payment/budget-summary - Authentication: None (Public)
- JSON Body: None
- Endpoint:
POST /api/quotations - Authentication: Admin (Bearer Token Required)
- Content-Type:
multipart/form-data - Mandatory Fields:
status,projectId,lineItems - Form Data:
status: "pending"projectId: "uuid"lineItems:[{"description": "Flooring", "amount": 10000}](Stringified JSON)totalAmount: 10000date: "2024-02-01"file: (File upload)
- Endpoint:
POST /api/messages - Authentication: Any Authenticated User (Bearer Token Required)
- Mandatory Fields:
message,receiverId - JSON Body:
{
"subject": "Project Query",
"message": "When is the deadline?",
"receiverId": "uuid-of-recipient",
"projectId": "uuid-of-project"
}- Endpoint:
GET /api/messages - Authentication: Any Authenticated User (Bearer Token Required)
- JSON Body: None
- Endpoint:
PATCH /api/messages/:messageId/read - Authentication: Any Authenticated User (Bearer Token Required)
- JSON Body: None
- URL Parameters:
messageId(UUID)
- Endpoint:
GET /api/notifications - Authentication: User (Bearer Token Required)
- Query Parameters:
unreadOnly(boolean, optional) - Example:
GET /api/notifications?unreadOnly=true - JSON Body: None
- Endpoint:
PATCH /api/notifications/mark-all-read - Authentication: User (Bearer Token Required)
- JSON Body: None
- Endpoint:
POST /api/auth/supervisor/login - Authentication: None (Public)
- Mandatory Fields:
email,password - JSON Body:
{
"email": "supervisor@example.com",
"password": "password123"
}- Response: Returns JWT token for supervisor authentication
- Endpoint:
GET /api/supervisor/profile - Authentication: Supervisor (Bearer Token Required)
- JSON Body: None
- Endpoint:
PUT /api/supervisor/profile - Authentication: Supervisor (Bearer Token Required)
- Mandatory Fields: None (Partial update)
- JSON Body:
{
"fullName": "Updated Name",
"email": "updated@example.com",
"phoneNumber": "1231231234"
}- Endpoint:
GET /api/supervisor/:supervisorId/assigned-projects - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
supervisorId(UUID)
- Endpoint:
GET /api/daily-updates - Authentication: None (Public)
- JSON Body: None
- Endpoint:
POST /api/daily-updates - Authentication: Supervisor (Bearer Token Required)
- Content-Type:
multipart/form-data - Mandatory Fields:
constructionStage,rawMaterials - Form Data:
constructionStage: "Foundation"description: "Work done today"projectId: "uuid"rawMaterials:[{"materialName": "Cement", "quantity": 10}](Stringified JSON)image: (File upload)video: (File upload)
- Endpoint:
GET /api/daily-updates/stage/:constructionStage - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
constructionStage(string)
- Endpoint:
DELETE /api/daily-updates/:dailyUpdateId - Authentication: Supervisor (Bearer Token Required)
- JSON Body: None
- URL Parameters:
dailyUpdateId(UUID)
- Endpoint:
POST /api/expense - Authentication: Admin/Supervisor (Bearer Token Required)
- Mandatory Fields:
projectId,category,amount,date - JSON Body:
{
"projectId": "uuid",
"category": "Labor",
"amount": 5000,
"date": "2024-02-01",
"description": "Daily wages"
}- Endpoint:
GET /api/expense - Authentication: None (Public)
- JSON Body: None
- Endpoint:
POST /api/material - Authentication: Admin/Supervisor (Bearer Token Required)
- Mandatory Fields:
projectId,materialName,quantity,date - JSON Body:
{
"projectId": "uuid",
"materialName": "Steel",
"quantity": 500,
"date": "2024-02-01",
"notes": "Grade A Steel"
}- Endpoint:
GET /api/material - Authentication: None (Public)
- JSON Body: None
- Endpoint:
GET /api/material/project/:projectId - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
projectId(UUID)
- Endpoint:
POST /api/messages - Authentication: Any Authenticated User (Bearer Token Required)
- Mandatory Fields:
message,receiverId - JSON Body:
{
"subject": "Project Query",
"message": "When is the deadline?",
"receiverId": "uuid-of-recipient",
"projectId": "uuid-of-project"
}- Endpoint:
GET /api/messages - Authentication: Any Authenticated User (Bearer Token Required)
- JSON Body: None
- Endpoint:
PATCH /api/messages/:messageId/read - Authentication: Any Authenticated User (Bearer Token Required)
- JSON Body: None
- URL Parameters:
messageId(UUID)
- Endpoint:
POST /api/auth/user/login - Authentication: None (Public)
- Mandatory Fields:
email,password - JSON Body:
{
"email": "user@example.com",
"password": "password123"
}- Response: Returns JWT token for user authentication
- Endpoint:
PUT /api/user/profile - Authentication: User (Bearer Token Required)
- Mandatory Fields: None (Partial update)
- JSON Body:
{
"userName": "John Updated",
"contact": "9876543210"
}- Endpoint:
POST /api/user/profile/change-password - Authentication: User (Bearer Token Required)
- Mandatory Fields:
currentPassword,newPassword,confirmNewPassword - JSON Body:
{
"currentPassword": "oldPassword",
"newPassword": "newPassword",
"confirmNewPassword": "newPassword"
}- Endpoint:
POST /api/user/:userId/approve-supervisor - Authentication: Customer (Bearer Token Required)
- JSON Body: None
- URL Parameters:
userId(UUID - should be the customer's own ID)
- Endpoint:
POST /api/user/:userId/reject-supervisor - Authentication: Customer (Bearer Token Required)
- JSON Body: None
- URL Parameters:
userId(UUID - should be the customer's own ID)
- Endpoint:
GET /api/user/supervisor/:supervisorId - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
supervisorId(UUID)
- Endpoint:
GET /api/daily-updates - Authentication: None (Public)
- JSON Body: None
- Endpoint:
GET /api/daily-updates/stage/:constructionStage - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
constructionStage(string)
- Endpoint:
PUT /api/daily-updates/:dailyUpdateId/approve - Authentication: Customer (Bearer Token Required)
- JSON Body: None
- URL Parameters:
dailyUpdateId(UUID)
- Endpoint:
PUT /api/daily-updates/:dailyUpdateId/reject - Authentication: Customer (Bearer Token Required)
- JSON Body: None
- URL Parameters:
dailyUpdateId(UUID)
- Endpoint:
GET /api/quotations/pending - Authentication: User (Bearer Token Required)
- JSON Body: None
- Endpoint:
POST /api/quotations/:quotationId/approve - Authentication: User (Bearer Token Required)
- JSON Body: None
- URL Parameters:
quotationId(UUID)
- Endpoint:
POST /api/quotations/:quotationId/reject - Authentication: User (Bearer Token Required)
- JSON Body: None
- URL Parameters:
quotationId(UUID)
- Endpoint:
GET /api/project/getproject/:projectId - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
projectId(UUID)
- Endpoint:
GET /api/project/getallprojects - Authentication: None (Public)
- JSON Body: None
- Endpoint:
GET /api/documents - Authentication: None (Public)
- Query Parameters:
documentType(optional),projectId(optional) - Example:
GET /api/documents?documentType=ARCHITECTURAL&projectId=uuid - JSON Body: None
- Endpoint:
GET /api/documents/:documentId/download - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
documentId(UUID)
- Endpoint:
POST /api/messages - Authentication: Any Authenticated User (Bearer Token Required)
- Mandatory Fields:
message,receiverId - JSON Body:
{
"subject": "Project Query",
"message": "When is the deadline?",
"receiverId": "uuid-of-recipient",
"projectId": "uuid-of-project"
}- Endpoint:
GET /api/messages - Authentication: Any Authenticated User (Bearer Token Required)
- JSON Body: None
- Endpoint:
PATCH /api/messages/:messageId/read - Authentication: Any Authenticated User (Bearer Token Required)
- JSON Body: None
- URL Parameters:
messageId(UUID)
- Endpoint:
GET /api/notifications - Authentication: User (Bearer Token Required)
- Query Parameters:
unreadOnly(boolean, optional) - Example:
GET /api/notifications?unreadOnly=true - JSON Body: None
- Endpoint:
PATCH /api/notifications/mark-all-read - Authentication: User (Bearer Token Required)
- JSON Body: None
- Endpoint:
GET /api/payment/budget-summary - Authentication: None (Public)
- JSON Body: None
- Endpoint:
GET /api/expense - Authentication: None (Public)
- JSON Body: None
- Endpoint:
GET /api/expense/summary/all-projects - Authentication: None (Public)
- JSON Body: None
- Endpoint:
GET /api/material - Authentication: None (Public)
- JSON Body: None
- Endpoint:
GET /api/material/project/:projectId - Authentication: None (Public)
- JSON Body: None
- URL Parameters:
projectId(UUID)
GET /api/user- Get all usersGET /api/user/:userId- Get user by IDGET /api/user/supervisor/:supervisorId- Get users by supervisor
GET /api/supervisor- Get all supervisorsGET /api/supervisor/:supervisorId- Get supervisor by IDGET /api/supervisor/:supervisorId/assigned-projects- Get assigned projects
GET /api/project/getproject/:projectId- Get project by IDGET /api/project/getallprojects- Get all projects
GET /api/daily-updates- Get all daily updatesGET /api/daily-updates/stage/:constructionStage- Get updates by stage
GET /api/documents- Get all documentsGET /api/documents/:documentId/download- Download document
GET /api/expense- Get all expensesGET /api/expense/summary/all-projects- Get expense summary
GET /api/material- Get all materialsGET /api/material/project/:projectId- Get materials by project
GET /api/payment/budget-summary- Get budget summary
For all authenticated endpoints, include the JWT token in the Authorization header:
Authorization: Bearer <your-jwt-token>
Example:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
All API responses follow a standard format:
Success Response:
{
"success": true,
"data": { ... },
"message": "Operation successful"
}Error Response:
{
"success": false,
"error": "Error message",
"statusCode": 400
}- UUID Format: All IDs (userId, projectId, supervisorId, etc.) are in UUID format
- Date Format: All dates should be in
YYYY-MM-DDformat - File Uploads: Use
multipart/form-datacontent type for file uploads - Query Parameters: Optional filters can be added to GET requests
- Partial Updates: PUT endpoints support partial updates (only send fields to update)