Update a user (super admin)
PUT
/users/{id}
const url = 'https://your-server.example/api/users/1';const options = { method: 'PUT', headers: {cookie: 'session=<session>', 'Content-Type': 'application/json'}, body: '{"display_name":"example","email":"hello@example.com","role":"example","password":"example","current_password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://your-server.example/api/users/1 \ --header 'Content-Type: application/json' \ --cookie session=<session> \ --data '{ "display_name": "example", "email": "hello@example.com", "role": "example", "password": "example", "current_password": "example" }'Pass current_password to authorise password resets.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer format: int64
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
display_name
string
email
string format: email
role
string
password
string
current_password
string
Example generated
{ "display_name": "example", "email": "hello@example.com", "role": "example", "password": "example", "current_password": "example"}Responses
Section titled “Responses”Updated user.
Media typeapplication/json
object
id
integer format: int64
username
string
role
string
display_name
string
email
string format: email
created_at
string format: date-time
Example
{ "role": "super_admin"}