updateUser
const url = 'https://example.com/api/v1/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {'X-CSRF-Token': 'example', 'Content-Type': 'application/json'}, body: '{"name":"example","username":"example","password":"example","role":"owner","active":true}'};
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/v1/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Content-Type: application/json' \ --header 'X-CSRF-Token: example' \ --data '{ "name": "example", "username": "example", "password": "example", "role": "owner", "active": true }'Update a dashboard user account. Requires an Owner or Administrator with the admin scope. Cookie-authenticated unsafe requests require X-CSRF-Token.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Role key. The built-in roles are owner, administrator, editor, contributor, and viewer. Custom role keys start with “custom.”. Decide authorization from the capabilities the server reports, not from the role key.
Responses
Section titled “ Responses ”User account updated
object
object
Role key. The built-in roles are owner, administrator, editor, contributor, and viewer. Custom role keys start with “custom.”. Decide authorization from the capabilities the server reports, not from the role key.
Example
{ "data": { "role": "owner" }}Invalid request body
Dashboard authentication required
Insufficient role
User not found
Username in use, self-deactivation, or last Owner
Name, username, password, or role invalid