PUT /users/<sid>
Sections
Replaces the user with the specified ID (sid) with a new user object. Authentication is required.
Request format
Accepts an updated user object with all keys
provided when the object is received from the API. The behavior varies based on user
type. All types have a role_id
array that indicates all the roles the user should belong to. An empty roles array
removes all roles directly assigned to the group.
The below examples show what keys must be submitted. Keys marked with asterisks are the only ones that can be changed via the API.
An example for a local user:
{"id": "c8b2c380-5889-11e4-8ed6-0800200c9a66",
"login": "Amari",
"email": "amariperez@example.com",
"display_name": "Amari Perez",
"role_ids": [1, 2, 3],
"is_group" : false,
"is_remote" : false,
"is_superuser" : false,
"is_revoked": false,
"last_login": "2014-05-04T02:32:00Z"}
Copied!
An example for a remote user:
{"id": "3271fde0-588a-11e4-8ed6-0800200c9a66",
"login": "Jean",
"email": "jeanjackson@example.com",
"display_name": "Jean Jackson",
"role_ids": [4, 1],
"inherited_role_ids": [],
"group_ids: [],
"is_group" : false,
"is_remote" : true,
"is_superuser" : false,
"is_revoked": false,
"last_login": "2014-05-04T02:32:00Z"}
Copied!
Response format
The request returns a 200 OK response, along with the user object with the changes made.
Error responses
If the login for the user conflicts with an existing user login, a 409 Conflict response is returned.