Overview
This endpoint allows authenticated users to update their basic profile information including name and phone number. Email cannot be updated through this endpoint.This endpoint requires authentication. Include a valid JWT token in the Authorization header.
Endpoint
Authentication
This endpoint requires authentication using a JWT Bearer token.Request Body
The user’s full name
- Minimum length: 2 characters
- Validation: Required, must be a string
The user’s phone number
- Maximum length: 20 characters
- Validation: Optional, nullable, must be a string if provided
Response
Indicates whether the request was successful
A message describing the result (localized based on Accept-Language header)
Example Request
Example Response
200 - Success
401 - Unauthorized
422 - Validation Error
500 - Server Error
Validation Rules
The following validation rules are applied to the request:| Field | Rules | Description |
|---|---|---|
name | required, string, min:2 | User’s full name (minimum 2 characters) |
phone | nullable, string, max:20 | User’s phone number (optional, max 20 characters) |
Implementation Details
This endpoint is implemented inUserController.php:55 and uses the following:
- Controller Method:
UserController::updateBasicInformation() - Request Validation:
UpdateUserRequest(defined inapp/Http/Requests/User/UpdateUserRequest.php:24) - Resource Transformation:
UserResource - Authentication Guard:
auth('api') - Route Name:
user.profile.update - Mass Assignable Fields:
name,phone(defined inUser.php:25)
Related Endpoints
- Get User Profile - Retrieve current user information
- Update Password - Change user’s password