Skip to content

Update User

Update existing user details, active status, or assigned role within a project.

Endpoint

/api/v1/projects/{project_id}/users/{user_id}

Method

PUT

Path Parameters

ParameterTypeRequiredDescription
project_idstringYesUnique ID of the project
user_idstringYesUnique ID of the user

Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
AuthorizationYesBearer access token: Bearer <access_token>

Request Body

FieldTypeRequiredDescription
display_namestringYesUser display name (max 50 chars)
avatar_urlstringNoAvatar URL
external_user_idstringConditionalRequired if email is not provided (max 100 chars)
emailstringConditionalOptional if external_user_id is provided (max 100 chars)
passwordstringNoOptional new password (min 8 chars). Leave empty to keep current password.
is_activebooleanYesActive status
role_idstringNoAssigned role ID
When updating optional fields like avatar_url, external_user_id, or email, provide an empty string or null to remove the existing value. The password field will retain its current value if left empty.

Required Permission

users:update

Examples

curl --request PUT \
  --url https://auth.roled.id/api/v1/projects/2JUSLUee46xG6iEwG8JwPc/users/2JRtk7i2aEFKpsKTNx6YWR \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJo...' \
  --header 'Content-Type: application/json' \
  --data '{
    "display_name": "Alice Smith",
    "avatar_url": null,
    "external_user_id": "921f28239dcd",
    "email": "alice.smith@example.com",
    "is_active": false
  }'

Error Codes

CodeHTTP StatusDescription
invalid_params400Missing or invalid request params, headers, or body
invalid_authorization_token401Missing or invalid authorization token
insufficient_permission403Insufficient permission
project_not_found404Project not found
role_not_found404Role not found
user_not_found404User not found
user_external_id_already_used409User with the same external user ID already exists
user_email_already_used409User with the same email already exists
system_error500Internal server error