Update a User
patch
/api/v2/users/{id}/
Make a PUT or PATCH request to this resource to update this user. The following fields may be modified:
username
: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (string, required)first_name
: (string, default=""
)last_name
: (string, default=""
)email
: (string, default=""
)is_superuser
: Designates that this user has all permissions without explicitly assigning them. (boolean, default=False
)is_system_auditor
: (boolean, default=False
)password
: Write-only field used to change the password. (string, default=""
)
For a PATCH request, include only the fields that are being modified.
Request
Supported Media Types
- application/json
Path Parameters
Query Parameters
-
search(optional): string
A search term.
Root Schema : schema
Example:
{
"last_login":"2018-02-01T08:00:00.000000Z"
}
Response
Supported Media Types
- application/json
200 Response
Example Response (application/json)
{
"auth":[
],
"created":"2018-02-01T08:00:00.000000Z",
"email":"",
"external_account":null,
"first_name":"",
"id":1,
"is_superuser":true,
"is_system_auditor":false,
"last_login":null,
"last_name":"",
"ldap_dn":"",
"related":{
"access_list":"/api/v2/users/1/access_list/",
"activity_stream":"/api/v2/users/1/activity_stream/",
"admin_of_organizations":"/api/v2/users/1/admin_of_organizations/",
"authorized_tokens":"/api/v2/users/1/authorized_tokens/",
"credentials":"/api/v2/users/1/credentials/",
"organizations":"/api/v2/users/1/organizations/",
"personal_tokens":"/api/v2/users/1/personal_tokens/",
"projects":"/api/v2/users/1/projects/",
"roles":"/api/v2/users/1/roles/",
"teams":"/api/v2/users/1/teams/",
"tokens":"/api/v2/users/1/tokens/"
},
"summary_fields":{
"user_capabilities":{
"delete":false,
"edit":true
}
},
"type":"user",
"url":"/api/v2/users/1/",
"username":"admin"
}