User Profile Management Service
Base URL: {base_url}/api/v1/profile
Short Description: The UserProfile API manages a user's social presence β what others see when they visit your page. This includes viewing your own full profile, looking up other users by ID or username, and updating your display information such as name, bio, location, and profile pictures.
Why Account and Profile ManagementAre ServiceSeparate:
userProfile = how you appear to others (display name, bio, location, picture, social stats). Account = who you are in the system (credentials, security, identity verification).
Profile operations are social in nature β some endpoints (
/id/{userId},/u/{username}) are intentionally viewable by any authenticated user, not just the owner. Account operations carry security implications and are always strictly private. By separating the two, we can apply the right access rules to each: profileupdates,datasecuritycansettings,be shared, accountverification,datapasswordcannot.changes,Anythingandthataccounttouchesmanagementcredentialsfor(password, 2FA, email, phone) belongs in theNextGateAccountsocialAPI,commercenotplatform.here.This service provides comprehensive profile management with security controls, two-factor authentication, and account verification capabilities.
Hints:
AllGETendpoints/merequirerequiresJWTauthentication;Bearerittokenreturnsauthenticationprivate fields likeemail,phoneNumber, andsecurityStrengthonly visible to the account ownerPasswordGETandchanges trigger automatic logout/id/{userId}requireGETwork for both authenticated and unauthenticated callers β authenticated callers additionally receivere-authentication/u/{username}relationshipinfo (isFollowing, isBlocked, etc.)UsernamePUTchanges/updaterequireonlyimmediateacceptsre-loginsocial/displaywithfieldsnewβcredentialsto Email/change username usePOST /api/v1/account/username/change; to change email or phoneupdatesuserequiretheOTPAccountverificationLinkingfor securityAPI- Profile picture URLs must be
validpubliclyHTTPSaccessiblehttps://image URLs(maxending in.jpg,.jpeg,.png,.gif, or.webp - Maximum 5
pictures)profile Securitypicturestrength is calculated based on verification status and 2FAAccount deactivation locks the account instead of deleting dataRate limiting applies to OTP verification requests (5URLs per10-minute window)account
EndpointsStandard Response Format
1.Success Get Current User Profile
Purpose: Retrieve complete profile information for the authenticated user
Endpoint: GET https://apinexgate.glueauth.com/api/v1/profile/me
Access Level: π Protected (Requires JWT Bearer token)
Authentication: Bearer Token (JWT access token required)
Request Headers:
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "ProfileOperation retrievedcompleted successfully",
"action_time": "2025-09-23T10:30:00"45",
"data": {}
}
Error Response Structure
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"userName": "johndoe-a1B2c3D",
"firstName": "John",
"lastName": "Doe",
"middleName": "Michael",
"email": "john.doe@example.com",
"phoneNumber": "+255712345678",
"isVerified": true,
"isEmailVerified": true,
"isPhoneVerified"success": false,
"isTwoFactorEnabled": false,
"isAccountLocked": false,
"createdAt"httpStatus": "2025-09-23T10:00:00"BAD_REQUEST",
"editedAt"message": "Error description",
"action_time": "2025-09-23T10:30:00"45",
"roles": ["ROLE_NORMAL_USER"],
"profilePictureUrls": [
"https://files.nextgate.com/bucket-uuid/profile/avatar1.jpg",
"https://files.nextgate.com/bucket-uuid/profile/avatar2.jpg"
],
"securityStrength": {
"score": 65,
"level"data": "MEDIUM",Error "description": "Your account security is good but can be improved",
"recommendations": [
"Verify your phone number",
"Enable two-factor authentication"
]
}
}
}
Standard Response Fields
:
| Field | Type | Description |
|---|---|---|
success |
true false for errors |
|
httpStatus |
string | HTTP status |
message |
Human-readable message describing the result | |
action_time |
string | ISO 8601 timestamp of when the response |
data |
||
Standard Error
Responses:
:401400UnauthorizedBAD_REQUESTMissingInvalid request data or business rule violation401 UNAUTHORIZED: Missing, expired, or invalid JWT token404: UserNot FoundNOT_FOUNDaccountnot found:500422Internal Server ErrorUNPROCESSABLE_ENTITYServer-side processingValidation errors with field-level detail500 INTERNAL_SERVER_ERROR: Unexpected server error
2.Endpoints
1. BasicGet My Profile Information
Purpose: UpdateReturns user'sthe basicfull profile informationof the currently authenticated user, including username,private names,fields (email, phone, and profile pictures
Endpoint: PUT https://apinexgate.glueauth.com/api/v1/profile/update-basic-info
Access Level: π Protected (Requires JWT Bearer token) β οΈ Username changes require re-authentication
Authentication: Bearer Token (JWT access token required)
Request Headers:
Request JSON Sample:
{
"userName": "johnsmith",
"firstName": "John",
"lastName": "Smith",
"middleName": "Michael",
"email": "john.smith@example.com",
"phoneNumber": "+255723456789",
"profilePictureUrls": [
"https://files.nextgate.com/bucket-uuid/profile/new-avatar.jpg",
"https://files.nextgate.com/bucket-uuid/profile/banner.jpg"
]
}
Request Body Parameters:
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Username changed successfully! You will be logged out automatically. Please login again with your new username.",
"action_time": "2025-09-23T10:35:00",
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"userName": "johnsmith",
"firstName": "John",
"lastName": "Smith",
"middleName": "Michael",
"email": "john.smith@example.com",
"phoneNumber": "+255723456789",
"isVerified": true,
"isEmailVerified": false,
"isPhoneVerified": false,
"isTwoFactorEnabled": false,
"isAccountLocked": false,
"createdAt": "2025-09-23T10:00:00",
"editedAt": "2025-09-23T10:35:00",
"roles": ["ROLE_NORMAL_USER"],
"profilePictureUrls": [
"https://files.nextgate.com/bucket-uuid/profile/new-avatar.jpg",
"https://files.nextgate.com/bucket-uuid/profile/banner.jpg"
],
"securityStrength": {
"score": 40,
"level": "WEAK",
"description": "Your accountstatus, security needs improvement",
"recommendations": [
"Verify your email address",
"Verify your phone number",
"Enable two-factor authentication"
]
}
}
}
Response Fields:
Error Responses:
400 Bad Request: Invalid input data or validation errors401 Unauthorized: Missing or invalid JWT token409 Conflict: Username or email already taken422 Unprocessable Entity: Validation errors (reserved username, invalid format)500 Internal Server Error: Server-side processing errors
3. Change Password
Purpose: Change user's password with current password verificationstrength) and strengthsocial validation
Endpoint: PUT https://apinexgate.glueauth.com/api/v1/profile/change-password
Access Level: π Protectedstats (Requiresfollowers, JWTposts, Bearershops, token) β οΈ Triggers automatic logout
Authentication: Bearer Token (JWT access token required)
Request Headers:
Request JSON Sample:
{
"currentPassword": "OldPassword123!",
"newPassword": "NewSecurePass456@",
"confirmPassword": "NewSecurePass456@"
}
Request Body Parameters:
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Password changed successfully",
"action_time": "2025-09-23T10:40:00",
"data": null
}
Response Fields:
Error Responses:
400 Bad Request: Invalid password format or passwords don't match401 Unauthorized: Missing or invalid JWT token or incorrect current password422 Unprocessable Entity: Password strength requirements not met500 Internal Server Error: Server-side processing errors
4. Validate Username Availability
Purpose: Check if a username is available and valid, with suggestions if taken
Endpoint: GET https://apinexgate.glueauth.com/api/v1/profile/validate-username/{username}
Access Level: π Protected (Requires JWT Bearer token)
Authentication: Bearer Token (JWT access token required)
Request Headers:
Path Parameters:
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Username validation completed",
"action_time": "2025-09-23T10:45:00",
"data": {
"available": false,
"valid": true,
"message": "This username is already taken",
"suggestions": [
"johnsmith1",
"johnsmith2",
"johnsmithuser",
"johnsmith2024",
"johnsmithpro"
],
"details": {
"correctLength": true,
"validFormat": true,
"notReserved": true,
"notTaken": false,
"formatRequirement": "Username must start with a letter and be 3-30 characters long"
}
}
}
Response Fields:
Error Responses:
400 Bad Request: Invalid username parameter401 Unauthorized: Missing or invalid JWT token500 Internal Server Error: Server-side processing errors
5. Request Email Verification
Purpose: Send OTP to user's email for email verification
Endpoint: POST https://apinexgate.glueauth.com/api/v1/profile/request-email-verification
Access Level: π Protected (Requires JWT Bearer token)
Authentication: Bearer Token (JWT access token required)
Request Headers:
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Email verification OTP sent successfully",
"action_time": "2025-09-23T10:50:00",
"data": {
"tempToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.events)..",
"message": "Verification email sent successfully",
"expireAt": "2025-09-23T11:00:00",
"email": "jo***@example.com"
}
}
Response Fields:
Error Responses:
400 Bad Request: Email already verified401 Unauthorized: Missing or invalid JWT token429 Too Many Requests: Rate limit exceeded for OTP requests500 Internal Server Error: Email sending or server errors
6. Verify Email
Purpose: Complete email verification using OTP code
Endpoint: POST https://apinexgate.glueauth.com/api/v1/profile/verify-email
Access Level: π Protected (Requires JWT Bearer token)
Authentication: Bearer Token (JWT access token required)
Request Headers:
Request JSON Sample:
{
"tempToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"otpCode": "123456"
}
Request Body Parameters:
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Email verified successfully",
"action_time": "2025-09-23T10:55:00",
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"userName": "johndoe-a1B2c3D",
"firstName": "John",
"lastName": "Doe",
"middleName": "Michael",
"email": "john.doe@example.com",
"phoneNumber": "+255712345678",
"isVerified": true,
"isEmailVerified": true,
"isPhoneVerified": false,
"isTwoFactorEnabled": false,
"isAccountLocked": false,
"createdAt": "2025-09-23T10:00:00",
"editedAt": "2025-09-23T10:55:00",
"roles": ["ROLE_NORMAL_USER"],
"profilePictureUrls": [],
"securityStrength": {
"score": 75,
"level": "MEDIUM",
"description": "Your account security is good but can be improved",
"recommendations": [
"Verify your phone number",
"Enable two-factor authentication"
]
}
}
}
Response Fields:
Error Responses:
400 Bad Request: Invalid OTP format or missing required fields401 Unauthorized: Missing or invalid JWT token or temp token422 Unprocessable Entity: OTP verification failed or token expired500 Internal Server Error: Server-side processing errors
7. Get Security Information
Purpose: Retrieve detailed security settings and account security strength
Endpoint: GET https://apinexgate.glueauth.com/api/v1/profile/security-info
Access Level: π Protected (Requires JWT Bearer token)
Authentication: Bearer Token (JWT access token required)
Request Headers:
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Security information retrieved successfully",
"action_time": "2025-09-23T11:00:00",
"data": {
"isEmailVerified": true,
"isPhoneVerified": false,
"isTwoFactorEnabled": false,
"isAccountLocked": false,
"lastPasswordChange": "2025-09-23T10:40:00",
"accountCreatedAt": "2025-09-23T10:00:00",
"roles": ["ROLE_NORMAL_USER"],
"securityStrength": {
"score": 75,
"level": "MEDIUM",
"description": "Your account security is good but can be improved",
"recommendations": [
"Verify your phone number",
"Enable two-factor authentication"
]
}
}
}
Response Fields:
Error Responses:
8. Enable Two-Factor Authentication
Purpose: Enable two-factor authentication for enhanced account security
Endpoint: POST https://apinexgate.glueauth.com/api/v1/profile/enable-2fa
Access Level: π Protected (Requires JWT Bearer token)
Authentication: Bearer Token (JWT access token required)
Request Headers:
Request JSON Sample:
{
"password": "CurrentPassword123!"
}
Request Body Parameters:
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Two-factor authentication enabled successfully",
"action_time": "2025-09-23T11:05:00",
"data": null
}
Response Fields:
Error Responses:
400 Bad Request: Missing password or 2FA already enabled401 Unauthorized: Missing or invalid JWT token or incorrect password422 Unprocessable Entity: Invalid password verification500 Internal Server Error: Server-side processing errors
9. Disable Two-Factor Authentication
Purpose: Disable two-factor authentication with password verification
Endpoint: POST https://apinexgate.glueauth.com/api/v1/profile/disable-2fa
Access Level: π Protected (Requires JWT Bearer token)
Authentication: Bearer Token (JWT access token required)
Request Headers:
Request JSON Sample:
{
"password": "CurrentPassword123!"
}
Request Body Parameters:
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Two-factor authentication disabled successfully",
"action_time": "2025-09-23T11:10:00",
"data": null
}
Response Fields:
Error Responses:
400 Bad Request: Missing password or 2FA not enabled401 Unauthorized: Missing or invalid JWT token or incorrect password422 Unprocessable Entity: Invalid password verification500 Internal Server Error: Server-side processing errors
10. Deactivate Account
Purpose: Deactivate (soft delete) user account with password verification
Endpoint: DELETE https://apinexgate.glueauth.com/api/v1/profile/deactivate
Access Level: π Protected (Requires JWT Bearer token) β οΈ Irreversible action
Authentication: Bearer Token (JWT access token required)
Request Headers:
Request JSON Sample:
{
"password": "CurrentPassword123!",
"reason": "No longer using the platform"
}
Request Body Parameters:
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Account deactivated successfully",
"action_time": "2025-09-23T11:15:00",
"data": null
}
Response Fields:
Error Responses:
400 Bad Request: Missing password or invalid reason length401 Unauthorized: Missing or invalid JWT token or incorrect password422 Unprocessable Entity: Invalid password verification500 Internal Server Error: Server-side processing errors
11. Get My Profile Summary (Modified from Get Current User Profile)
Purpose: Retrieve the authenticated user's profile summary with stats
Endpoint: GET {base_url}/api/v1/profile/me
Access Level: π Protected (Requires Authentication)valid JWT β own profile only)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Profile retrieved successfully",
"action_time": "2026-05-19T10:30:45",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"userName": "john_doe",
"firstName": "John",
"lastName": "Doe",
"middleName": null,
"email": "john@example.com",
"phoneNumber": "+254712345678",
"bio": "Building cool things.",
"location": "Nairobi, Kenya",
"profilePictureUrls": [
"https://cdn.example.com/profiles/john_main.jpg"
],
"isVerified": true,
"isEmailVerified": true,
"isPhoneVerified": true,
"isTwoFactorEnabled": false,
"isAccountLocked": false,
"followersCount": 1420,
"followingCount": 310,
"postsCount": 42,
"shopsCount": 1,
"eventsCount": 3,
"createdAt": "2025-12-29T17:01T14:00:00",
"editedAt": "2026-05-10T08:22:00",
"roles": ["ROLE_USER"],
"securityStrength": {
"score": 50,
"level": "MEDIUM",
"description": "Your account security is good but can be improved",
"recommendations": ["Enable two-factor authentication"]
}
}
}
Success Response Fields:
| Field | Description |
|---|---|
id |
Account UUID |
userName |
Public username |
firstName |
First name |
lastName |
Last name |
middleName |
Middle name (may be null) |
email |
Linked email address (private β only visible to owner) |
phoneNumber |
Linked phone number (private β only visible to owner) |
bio |
Profile bio text |
location |
Location string |
profilePictureUrls |
Array of profile picture URLs (first is primary) |
isVerified |
Whether the account has been verified |
isEmailVerified |
Whether the email has been verified |
isPhoneVerified |
Whether the phone has been verified |
isTwoFactorEnabled |
Whether 2FA is active |
isAccountLocked |
Whether the account is deactivated or locked |
followersCount |
Number of accepted followers |
followingCount |
Number of accounts the user is following |
postsCount |
Number of published posts |
shopsCount |
Number of active shops |
eventsCount |
Number of published events |
createdAt |
ISO 8601 account creation timestamp |
editedAt |
ISO 8601 last profile update timestamp |
roles |
Array of assigned role strings |
securityStrength.score |
Security health score 0β100 |
securityStrength.level |
VERY_WEAK, WEAK, MEDIUM, or STRONG |
securityStrength.recommendations |
Actionable steps to improve security score |
Error Response JSON Sample:
{
"success": false,
"httpStatus": "UNAUTHORIZED",
"message": "Token has expired",
"action_time": "2026-05-19T10:30:45",
"data": "Token has expired"
}
2. Get Profile by User ID
Purpose: Returns the public profile summary of any user by their UUID. Authenticated callers additionally receive relationship context (isFollowing, isBlocked, etc.).
Endpoint: GET {base_url}/api/v1/profile/id/{userId}
Access Level: π Public (Relationship info available when authenticated)
Authentication: Bearer Token (optional)
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | No | Bearer <jwt_token> β include to get relationship data |
Path Parameters:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
userId |
UUID | Yes | The UUID of the user whose profile to fetch | Valid UUID format |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Profile retrieved successfully",
"action_time": "2026-05-19T10:30:45",
"data": {
"userId": "550e8400-e29b-41d4-a716-446655440000",
"userName": "john_doe",
"firstName": "John",
"lastName": "Doe",
"profilePictureUrl": "https://storage.cdn.example.com/profiles/john.john_main.jpg",
"bio": "TechBuilding enthusiastcool | Entrepreneur | Dar es Salaam"things.",
"location": "DarNairobi, es Salaam, Tanzania"Kenya",
"isVerified": true,
"followersCount": 1250,1420,
"followingCount": 340,310,
"postsCount": 85,
"shopsCount": 2,
"eventsCount": 5,
"createdAt": "2024-03-15T08:00:00",
"isOwnProfile": true,
"relationship": null
}
}
Success Response Fields:
| |
|
Error Response JSON Sample:
{
"success": false,
"httpStatus": "UNAUTHORIZED",
"message": "User not authenticated",
"action_time": "2025-12-29T17:00:00",
"data": null
}
Standard Error Types:
12. Get User Profile by ID
Purpose: Retrieve a user's profile summary by their unique ID
Endpoint: GET {base_url}/api/v1/profile/id/{userId}
Access Level: π Protected (Requires Authentication)
Authentication: Bearer Token
Request Headers:
Path Parameters:
Success Response JSON Sample (Viewing Other User):
{
"success": true,
"httpStatus": "OK",
"message": "Profile retrieved successfully",
"action_time": "2025-12-29T17:00:00",
"data": {
"userId": "660e8400-e29b-41d4-a716-446655440001",
"userName": "jane_smith",
"firstName": "Jane",
"lastName": "Smith",
"profilePictureUrl": "https://storage.example.com/profiles/jane.jpg",
"bio": "Fashion designer | Shop owner | Arusha",
"location": "Arusha, Tanzania",
"isVerified": true,
"followersCount": 5420,
"followingCount": 180,
"postsCount": 320,42,
"shopsCount": 1,
"eventsCount": 12,3,
"createdAt": "2023-08-20T10:2025-12-01T14:00:00",
"isOwnProfile": false,
"relationship": {
"isFollowing": true,
"isFollowedBy": false,
"isBlocked": false,
"isBlockedBy": false
}
}
}
Success Response Fields:
| Field | Description |
|---|---|
userId |
Account UUID |
userName |
Public username |
firstName |
First name |
lastName |
Last name |
profilePictureUrl |
Primary profile picture URL (first in the list, may be null) |
bio |
Profile bio |
location |
Location string |
isVerified |
Whether the account has been platform-verified |
followersCount |
Number of accepted followers |
followingCount |
Number of accounts the user follows |
postsCount |
Number of published posts |
shopsCount |
Number of active shops |
eventsCount |
Number of published events |
createdAt |
ISO 8601 account creation timestamp |
isOwnProfile |
true if the authenticated caller is viewing their own profile |
relationship |
Present only when the caller is authenticated and viewing someone else's profile |
relationship.isFollowing |
true if the caller follows this user |
relationship.isFollowedBy |
true if this user follows the caller |
relationship.isBlocked |
true if the caller has blocked this user |
relationship.isBlockedBy |
true if this user has blocked the caller |
Error Response JSON Sample:
{
Own"success": false,
"httpStatus": "NOT_FOUND",
"message": "User not found",
"action_time": "2026-05-19T10:30:45",
"data": "User not found"
}
3. Get Profile by ID)Username
Purpose: Returns the public profile summary of any user by their username. Authenticated callers additionally receive relationship context. Functionally identical to endpoint 2 but accessed via username instead of UUID.
Endpoint: GET {base_url}/api/v1/profile/u/{username}
Access Level: π Public (Relationship info available when authenticated)
Authentication: Bearer Token (optional)
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | No | Bearer <jwt_token> β include to get relationship data |
Path Parameters:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
username |
string | Yes | The public username to look up | Supports @username format |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Profile retrieved successfully",
"action_time": "2025-12-29T17:00:00"2026-05-19T10:30:45",
"data": {
"userId": "550e8400-e29b-41d4-a716-446655440000",
"userName": "john_doe",
"firstName": "John",
"lastName": "Doe",
"profilePictureUrl": "https://storage.cdn.example.com/profiles/john.john_main.jpg",
"bio": "TechBuilding enthusiastcool | Entrepreneur | Dar es Salaam"things.",
"location": "DarNairobi, es Salaam, Tanzania"Kenya",
"isVerified": true,
"followersCount": 1250,1420,
"followingCount": 340,310,
"postsCount": 85,42,
"shopsCount": 2,1,
"eventsCount": 5,3,
"createdAt": "2024-03-15T08:2025-12-01T14:00:00",
"isOwnProfile": true,false,
"relationship": null{
"isFollowing": false,
"isFollowedBy": false,
"isBlocked": false,
"isBlockedBy": false
}
}
}
Success Response Fields: Same as endpoint 2 β see Get Profile by User ID.
| |
|
Relationship Object Fields:
Error Response JSON Sample:
{
"success": false,
"httpStatus": "BAD_REQUEST"NOT_FOUND",
"message": "User not found",
"action_time": "2025-12-29T17:00:00"2026-05-19T10:30:45",
"data": null"User not found"
}
Standard Error Types:
400 BAD_REQUEST: User not found401 UNAUTHORIZED: Missing or invalid authentication token
13.4. Get UserUpdate Profile by Username
Purpose: RetrieveUpdates athe authenticated user's profilesocial/display summaryinformation. Only accepts social fields β username changes, email changes, and phone changes are handled by theirthe usernameAccount API. All fields are optional; only fields provided will be updated.
Endpoint: GETPUT {base_url}/api/v1/profile/u/{username}update
Access Level: π Protected (Requires Authentication)valid JWT β own profile only)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer |
Content-Type |
string | Yes | application/json |
PathRequest JSON Sample:
{
"firstName": "John",
"lastName": "Doe",
"middleName": "K",
"bio": "Building cool things one commit at a time.",
"location": "Nairobi, Kenya",
"profilePictureUrls": [
"https://cdn.example.com/profiles/john_main.jpg",
"https://cdn.example.com/profiles/john_alt.jpg"
]
}
Request Body Parameters:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
firstName |
string | 1β30 characters | ||
lastName |
string | No | Last name | 1β30 characters |
middleName |
string | No | Middle name | Max 30 characters |
bio |
string | No | Short bio shown on profile | No length constraint enforced here |
location |
string | No | Location string shown on profile | No length constraint enforced here |
profilePictureUrls |
array of |
Ordered |
Max 5 items; each URL must be a valid https:// image URL ending in .jpg, .jpeg, .png, .gif, or .webp; max 500 characters per URL |
Note: To change your username, use
POST /api/v1/account/username/change. To change your email or phone number, use the Account Linking API (/api/v1/account/link).
Success Response JSON Sample (Viewing Other User):
{
"success": true,
"httpStatus": "OK",
"message": "Profile retrievedupdated successfully",
"action_time": "2025-12-29T17:00:00"2026-05-19T10:30:45",
"data": {
"userId": "660e8400-e29b-41d4-a716-446655440001",
"userName": "jane_smith",
"firstName": "Jane",
"lastName": "Smith",
"profilePictureUrl": "https://storage.example.com/profiles/jane.jpg",
"bio": "Fashion designer | Shop owner | Arusha",
"location": "Arusha, Tanzania",
"isVerified": true,
"followersCount": 5420,
"followingCount": 180,
"postsCount": 320,
"shopsCount": 1,
"eventsCount": 12,
"createdAt": "2023-08-20T10:00:00",
"isOwnProfile": false,
"relationship": {
"isFollowing": true,
"isFollowedBy": true,
"isBlocked": false,
"isBlockedBy": false
}
}
}
Success Response JSON Sample (Viewing Own Profile by Username):
{
"success": true,
"httpStatus": "OK",
"message": "Profile retrieved successfully",
"action_time": "2025-12-29T17:00:00",
"data": {
"userId"id": "550e8400-e29b-41d4-a716-446655440000",
"userName": "john_doe",
"firstName": "John",
"lastName": "Doe",
"profilePictureUrl"middleName": "https://storage.example.com/profiles/john.jpg"K",
"email": "john@example.com",
"phoneNumber": "+254712345678",
"bio": "TechBuilding enthusiastcool |things Entrepreneurone |commit Darat esa Salaam"time.",
"location": "DarNairobi, esKenya",
Salaam,"profilePictureUrls": Tanzania"[
"https://cdn.example.com/profiles/john_main.jpg",
"https://cdn.example.com/profiles/john_alt.jpg"
],
"isVerified": true,
"followersCount"isEmailVerified": 1250,true,
"followingCount"isPhoneVerified": 340,true,
"postsCount"isTwoFactorEnabled": 85,false,
"shopsCount"isAccountLocked": 2,
"eventsCount": 5,false,
"createdAt": "2024-03-15T08:2025-12-01T14:00:00",
"isOwnProfile"editedAt": true,"2026-05-19T10:30:45",
"relationship"roles": null["ROLE_USER"],
"securityStrength": {
"score": 50,
"level": "MEDIUM",
"description": "Your account security is good but can be improved",
"recommendations": ["Enable two-factor authentication"]
}
}
}
Success Response Fields:
| Field | Description |
|---|---|
id |
|
userName |
|
firstName |
|
lastName |
|
middleName |
|
email |
|
phoneNumber |
|
bio |
Updated bio |
location |
Updated location |
profilePictureUrls |
|
isVerified |
|
isEmailVerified |
|
isPhoneVerified |
|
isTwoFactorEnabled |
|
isAccountLocked |
|
createdAt |
Account creation |
editedAt |
Updated |
roles |
|
Relationship Object Fields:
securityStrength |
|
Error Response JSON Sample:
{
"success": false,
"httpStatus": "BAD_REQUEST"UNPROCESSABLE_ENTITY",
"message": "UserValidation not found"failed",
"action_time": "2025-12-29T17:00:00"2026-05-19T10:30:45",
"data": null{
"firstName": "First name must be between 1 and 30 characters",
"profilePictureUrls": "Maximum 5 profile pictures allowed"
}
}
Standard Error Types:
400 BAD_REQUEST: User not found401 UNAUTHORIZED: Missing or invalid authentication token
Quick Reference β All Profile Endpoints Summary
| # | Method | Endpoint | | Description |
||
|---|---|---|---|---|---|---|
| 1 | GET | |
| profile own account only |
||
| 2 | GET | |
Public profile by | | |
|
| 3 | GET | |
Public profile by username | |||
4 |
PUT | |
π |
Update display info |
RelationshipWhat FieldBelongs Logicin Profile vs Account
| Use |
|
|---|---|---|
|
| GET |
|
| or |
location, or picture |
| PUT |
|
||
| Change my email address | |
|
| Change |
Phone OTP verification flow | |
| Change my password | POST /api/v1/account/password/change |
|
| Enable or disable 2FA | POST /api/v1/account/2fa/enable or /disable |
|
| Verify my email | POST /api/v1/account/email/request-verification β /email/verify |
|
| View my security status | GET /api/v1/account/security-info |
|
| Deactivate my account | DELETE /api/v1/account/deactivate |
Frontend Usage Example
const profile = response.data;
if (profile.isOwnProfile) {
// Show edit profile button
// Hide follow/block buttons
showEditProfileButton();
} else {
// Show follow button based on relationship
if (profile.relationship.isFollowing) {
showUnfollowButton();
} else {
showFollowButton();
}
// Show "Follows you" badge
if (profile.relationship.isFollowedBy) {
showFollowsYouBadge();
}
// Handle blocked state
if (profile.relationship.isBlockedBy) {
showLimitedProfile();
disableInteractions();
}
}
Quick Reference Guide
Security Strength Scoring
Email Verification: 25 pointsPhone Verification: 25 pointsTwo-Factor Authentication: 35 pointsRecent Password Change: 15 points (within 6 months)
Security Levels
STRONG (80-100): Excellent securityMEDIUM (60-79): Good security, can be improvedWEAK (40-59): Needs improvementVERY_WEAK (0-39): Poor security, immediate attention needed
Profile Picture Requirements
Format: HTTPS URLs onlyFile Types: JPG, JPEG, PNG, GIF, WebPLimit: Maximum 5 profile picturesSize: No specific limit (handled by file service)Security: SSRF protection implemented
Common HTTP Status Codes
200 OK: Successful GET/PUT request204 No Content: Successful DELETE request400 Bad Request: Invalid request data401 Unauthorized: Authentication required/failed403 Forbidden: Insufficient permissions404 Not Found: Resource not found409 Conflict: Username/email already taken422 Unprocessable Entity: Validation errors429 Too Many Requests: Rate limit exceeded500 Internal Server Error: Server error
Authentication Types
Bearer Token: IncludeAuthorization: Bearer your_access_tokenin headersPassword Verification: Required for sensitive operations (password change, 2FA, deactivation)OTP Verification: Required for email/phone verificationRe-authentication: Required after username changes
Data Format Standards
Dates: Use ISO 8601 format (2025-09-23T10:30:00Z)Phone Numbers: E.164 international format (+1234567890)UUIDs: Standard UUID format for all identifiersURLs: Full HTTPS URLs for profile picturesPasswords: Min 8 chars, uppercase, lowercase, digit, special character