Skip to main content
PUT
/
api
/
users
/
:id
Update User
curl --request PUT \
  --url https://api.example.com/api/users/:id \
  --header 'Content-Type: application/json' \
  --data '
{
  "firstName": "<string>",
  "lastName": "<string>",
  "phone": "<string>",
  "address": "<string>",
  "role": "<string>",
  "isActive": true,
  "supervisorId": "<string>"
}
'
{
  "id": "<string>",
  "email": "<string>",
  "role": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "phone": "<string>",
  "profileImage": "<string>",
  "updatedAt": "<string>"
}
Update an existing user’s profile and settings.

Authentication

Required. Users can update their own profile. Admins can update any user.

Path Parameters

id
string
required
User ID to update

Request Body

All fields are optional. Only provided fields will be updated.
firstName
string
User’s first name
lastName
string
User’s last name
phone
string
Contact phone number
address
string
Physical address
profileImage
file
Profile image file (multipart/form-data)Maximum size: 5MBAccepted formats: image/jpeg, image/png, image/gif
role
string
User role (Admin only)
isActive
boolean
Account active status (Admin only)
supervisorId
string
Supervisor ID (Admin only, for Credit Officers)

Response

id
string
User identifier
email
string
User’s email address
role
string
User role
firstName
string
Updated first name
lastName
string
Updated last name
phone
string
Updated phone number
profileImage
string
URL to profile image
updatedAt
string
ISO timestamp of last update

Example Request

cURL (JSON)
curl -X PUT "https://api.millenium-potters.com/api/users/clx789ghi" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Jane",
    "lastName": "Doe",
    "phone": "+234-800-5678"
  }'
cURL (with image)
curl -X PUT "https://api.millenium-potters.com/api/users/clx789ghi" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "firstName=Jane" \
  -F "lastName=Doe" \
  -F "profileImage=@/path/to/image.jpg"

Example Response

{
  "id": "clx789ghi",
  "email": "[email protected]",
  "role": "CREDIT_OFFICER",
  "firstName": "Jane",
  "lastName": "Doe",
  "phone": "+234-800-5678",
  "profileImage": "/uploads/profiles/profile-789.jpg",
  "updatedAt": "2026-03-11T11:00:00Z"
}

Error Responses

Missing or invalid authentication token.
User does not have permission to update this profile.
User with specified ID does not exist.
Invalid request. Common issues:
  • Image file too large (> 5MB)
  • Invalid image format
  • Invalid role value
Changing a user’s role or supervisorId requires Admin permissions. Regular users cannot modify these fields.

Build docs developers (and LLMs) love