Profile
The Profile API allows users to manage their profile information.
Update Profile
PUT
/api/v1/update-profile
Update the authenticated user's profile information.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | Username (max 64 characters) |
| string | Yes | Valid email address | |
| password | string | No | Password (min 8 characters, must be confirmed) |
| password_confirmation | string | No | Password confirmation (required if password is provided) |
| first_name | string | Yes | First name (max 64 characters) |
| last_name | string | Yes | Last name (max 64 characters) |
| gender | string | Yes | Gender (male or female) |
| birthday | date | Yes | Date of birth |
| country_id | integer | No | ID of the user's country |
Example Request
{
"username": "johndoe",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"gender": "male",
"birthday": "1990-01-01",
"country_id": 1
}
Response
{
"message": "Profile updated successfully",
"data": {
"user_id": 1,
"username": "johndoe",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"gender": "male",
"birthday": "1990-01-01",
"country_id": 1,
"user_status": "active",
"role_id": 2
}
}
Error Responses
| Status | Description |
|---|---|
| 401 | Unauthenticated - User is not logged in |
| 403 | Forbidden - User does not have permission to update this profile |
| 422 | Validation Error - Invalid or missing fields |