Update a user (v2)
PUT/tap/api/v2/users/:userId
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
Deprecated; use PUT /tap/api/v3/users/{userId}. Differs from v3 only in awsRoles: the request accepts AWS role objects, of which only id is read, as well as AWS role ids, and the response lists AWS role objects. Updates a user. Only the fields present in the request body are changed; a field sent as null is treated as omitted. Allowed for an admin or the user themselves; only an admin may change userRole, active, commonName, or awsRoles (a non-admin may send them unchanged). An AWS role id the user does not already have must belong to an existing AWS role. Group memberships are updated when fullName, email, or userRole changes. Changing commonName or fullName does not issue a new certificate; use POST /tap/api/v3/users/{userId}/certificate. Certificate files are stored under a name derived from fullName, so after fullName changes, download links point to a bundle that does not exist and POST /tap/api/v3/users/{userId}/certificate/bundle builds a bundle without the user's certificate until the certificate is rebuilt. bundlePath in the response is the stored location of the certificate bundle, not a download link.
Request
Responses
- 200
- 400
- 403
- 404
- 422
- 500
The result of the update. When the change could not be saved, success is false and data is absent; this includes a userRole that is not exactly user, admin, or super_admin.
The caller has the admin role and the identifier is not a number, awsRoles is not a list of AWS roles or AWS role ids, awsRoles adds an AWS role id that does not exist, or the email is already used by another user. Emails are compared without regard to case.
The caller is not allowed to make this change: the caller is neither an admin nor the user, a non-admin tried to change an admin-only field, the caller tried to assign or modify a super_admin without being one, or reactivating the user would exceed the account user limit.
No user exists with the given identifier, or the identifier belongs to a server.
Email domain validation is on and the email domain is not allowed. The submitted email is checked, or the stored email when email is omitted; the check is skipped when active changes and fullName, email, userRole, and the AWS role ids do not.
The user could not be updated, including when the request body is not a JSON object or a field has the wrong type.