Skip to main content
GET
/
profile
Get user profile
curl --request GET \
  --url http://localhost:2000/profile \
  --header 'Authorization: Bearer <token>'
{
  "message": "<string>",
  "data": {}
}
Endpoint to get the profile of the logged in user.

Request

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token

Response

200 OK - Successfully retrieved profile

{
  "message": "Profile retrieved successfully",
  "data": {
    "_id": "64b7f1a2e4b0a5d3f9c12345",
    "emails": "[email protected]",
    "role": "user",
    "rcExtension": "1234",
    "phone": "+1-555-555-5555",
    "department": {
      "_id": "64b7f2b3e4b0a5d3f9c54321",
      "name": "Customer Support"
    },
    "permissions": ["compass.dashboard.*", "compass.dashboard.overview"]
  }
}

400 Bad Request

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request"
  }
}

401 Unauthorized

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Missing or invalid authentication token"
  }
}

404 Not Found

{
  "error": {
    "code": "USER_NOT_FOUND",
    "message": "User not found"
  }
}

500 Internal Server Error

{
  "error": {
    "code": "SERVER_ERROR",
    "message": "Internal server error"
  }
}

Example

curl -X GET 'http://localhost:2000/profile' \
  -H 'Authorization: Bearer your-jwt-token'

Notes

  • This endpoint returns the complete profile information for the authenticated user
  • Includes user details, department information, and assigned permissions
  • Use this to populate user profile pages or verify user session
  • The response contains sensitive information and should be handled securely

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

message
string
data
object