Skip to main content

Update User Profile API

Overview

Allows an authenticated user to view or update their own user profile details (first name, last name, phone, date of birth, gender, address, pincode).

  • Endpoints:
    • GET /api/users/profile or POST /api/users/profile (Get Self Profile)
    • POST /api/users/update-profile or GET /api/users/update-profile (Update Self Profile)
  • Method: GET or POST
  • Auth Required: Yes (Bearer <token>)

Get Self Profile

Request

GET /api/users/profile Headers: Authorization: Bearer <user_jwt_token>

Response (200 OK)

{
"success": true,
"message": "User profile retrieved successfully",
"data": {
"id": "e89c6295-88a4-44b4-a46c-2f960fcdbb1d",
"email": "employee@example.com",
"firstName": "John",
"lastName": "Doe",
"phone": "+919876543210",
"clientType": "B2B",
"companyId": "060d4b29-df13-43ef-aa2a-bd1e5ccebfa2",
"departmentId": "4a737f90-1c66-4191-8be9-e09210214a1a",
"employeeBand": "B2",
"bandId": "73c683b5-773a-449e-b9cb-fb1bca1e9882",
"approvalLimit": "10000.00",
"dateOfBirth": "1995-08-15T00:00:00.000Z",
"gender": "Male",
"addressLine1": "123 Business Park",
"addressLine2": "Suite 400",
"pincode": "400001",
"loyaltyPoints": 0,
"active": true,
"createdAt": "2026-09-02T06:00:00.000Z",
"updatedAt": "2026-09-02T10:00:00.000Z",
"company": {
"id": "060d4b29-df13-43ef-aa2a-bd1e5ccebfa2",
"name": "Acme Corp",
"legalName": "Acme Private Limited",
"gstin": "27AAACA1234A1Z5",
"active": true
},
"department": {
"id": "4a737f90-1c66-4191-8be9-e09210214a1a",
"name": "Engineering",
"costCode": "ENG-001"
},
"band": {
"id": "73c683b5-773a-449e-b9cb-fb1bca1e9882",
"name": "Senior Software Engineer",
"code": "B2",
"autoApprovalLimit": "7000.00",
"maxBookingLimit": null
},
"companyRoles": [
{
"id": "role-uuid-1",
"companyId": "060d4b29-df13-43ef-aa2a-bd1e5ccebfa2",
"role": "COMPANY_EMPLOYEE"
}
],
"systemRoleMap": {
"role": "USER",
"active": true
},
"roles": [
"COMPANY_EMPLOYEE"
]
}
}

Update Self Profile

Request Body Parameters

FieldTypeRequiredDescription
firstNameStringNoUpdated first name
lastNameStringNoUpdated last name
phoneStringNoUpdated contact phone number
dateOfBirthString (YYYY-MM-DD)NoUpdated date of birth
genderStringNoUpdated gender (e.g. "Male", "Female", "Other")
addressLine1StringNoPrimary street address
addressLine2StringNoApartment, suite, or building details
pincodeStringNoPostal code

Request Example

POST /api/users/update-profile Headers: Authorization: Bearer <user_jwt_token>

{
"firstName": "John",
"lastName": "Smith",
"phone": "+919876543210",
"dateOfBirth": "1995-08-15",
"gender": "Male",
"addressLine1": "123 Tech Park",
"pincode": "400001"
}

Response (200 OK)

{
"success": true,
"message": "Profile updated successfully",
"data": {
"id": "e89c6295-88a4-44b4-a46c-2f960fcdbb1d",
"email": "employee@example.com",
"firstName": "John",
"lastName": "Smith",
"phone": "+919876543210",
"clientType": "B2B",
"companyId": "060d4b29-df13-43ef-aa2a-bd1e5ccebfa2",
"departmentId": "4a737f90-1c66-4191-8be9-e09210214a1a",
"employeeBand": "B2",
"bandId": "73c683b5-773a-449e-b9cb-fb1bca1e9882",
"approvalLimit": "10000.00",
"dateOfBirth": "1995-08-15T00:00:00.000Z",
"gender": "Male",
"addressLine1": "123 Tech Park",
"addressLine2": null,
"pincode": "400001",
"loyaltyPoints": 0,
"active": true,
"createdAt": "2026-09-02T06:00:00.000Z",
"updatedAt": "2026-09-02T10:40:00.000Z",
"company": {
"id": "060d4b29-df13-43ef-aa2a-bd1e5ccebfa2",
"name": "Acme Corp",
"legalName": "Acme Private Limited"
},
"department": {
"id": "4a737f90-1c66-4191-8be9-e09210214a1a",
"name": "Engineering"
},
"band": {
"id": "73c683b5-773a-449e-b9cb-fb1bca1e9882",
"name": "Senior Software Engineer",
"code": "B2"
},
"roles": [
"COMPANY_EMPLOYEE"
]
}
}