PUT
/users/{id}
Update user
Users
Description
Update information for a specific user.
Authentication Required: User must be authenticated.
Authorization: Users can only update their own profile.
Email Verification: If the email address is changed, the user's email will be marked as unverified and a verification email will be sent to the new email address. The user must verify the new email to restore access to features.
Parameters
id
integer
path
required
User ID
Request Body
requiredapplication/json
userobject
first_namestring
Example:
Johnlast_namestring
Example:
Doeemailstring (email)
Example:
[email protected]passwordstring (password)
Example:
newsecurepassword123feature_flagsarray [string]
User's feature flags (optional, editable)
Example:
["affiliate"]notificationsarray [string]
User's notification preferences (optional, editable)
Example:
["email_new_transaction","push_new_transaction"]localestringenum: en, fr
User's preferred language (optional, editable)
Example:
enexpo_push_tokenstring
Expo push notification token for mobile app notifications. Must be in format ExponentPushToken[...] or ExpoPushToken[...] (optional, editable)
Example:
ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]Responses
200
User updated successfully
application/jsonstatusstring
Example:
successmessagestring
Example:
User updated successfullydataobject
Example:
{
"status": "success",
"message": "User updated successfully",
"data": {
"id": 1,
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"roles": [],
"feature_flags": [
"affiliate"
],
"notifications": [
"email_new_transaction",
"push_new_transaction"
],
"status": "active",
"locale": "en",
"created_at": "2024-01-15T10:30:00Z"
}
}
401
Authentication required
application/jsonExample:
{
"status": "error",
"message": "Not authenticated or insufficient permissions"
}
404
User not found
application/jsonExample:
{
"status": "error",
"message": "User not found"
}
422
Validation error
application/jsonstatusstring
Example:
errormessagestring
Example:
Failed to update usererrorsarray [object]
Example:
[{"path":"email","message":"Email has already been taken"},{"path":"password","message":"Password is too short (minimum is 8 characters)"}]pathstring
The property path that failed validation
messagestring
The full error message