Update User
PATCH
/api/users/{user_id}
const url = 'https://example.com/api/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"email":"hello@example.com","full_name":"example","is_active":true,"is_superuser":true,"timezone":"example","username":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/api/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "hello@example.com", "full_name": "example", "is_active": true, "is_superuser": true, "timezone": "example", "username": "example" }'Update user (superuser only).
Unlike the self-service PATCH /me, a superuser MAY change email directly
(a support/ops action, not a self-service one — still subject to the
same uniqueness check, but skips the new-address-verification flow since
an admin action already carries a different trust level). Uses
SuperuserUserUpdate rather than UserUpdate: the former has no password
field, so there’s no dead setattr(user, “password”, …) on a column
that doesn’t exist (User only has hashed_password).
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” user_id
required
User Id
string format: uuid
Request Bodyrequired
Section titled “ Request Bodyrequired ” Media type application/json
SuperuserUserUpdate
Admin-only user update — unlike UserUpdate, superusers MAY change a user’s email directly (support/ops action), still subject to the same uniqueness check as the self-service path.
object
Example generated
{ "email": "hello@example.com", "full_name": "example", "is_active": true, "is_superuser": true, "timezone": "example", "username": "example"}Responses
Section titled “ Responses ”Successful Response
Media type application/json
UserResponse
User response schema
object
created_at
required
Created At
string format: date-time
current_terms_version
Current Terms Version
string
email
required
Email
string format: email
id
required
Id
string format: uuid
is_active
required
Is Active
boolean
is_superuser
Is Superuser
boolean
is_verified
required
Is Verified
boolean
terms_acceptance_required
Terms Acceptance Required
boolean
username
required
Username
string
Example
{ "current_terms_version": "", "is_superuser": false, "terms_acceptance_required": false, "timezone": "UTC"}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}