Swagger Petstore - OpenAPI 3.0
PUT/user/{username}

Update a user

Replaces the details of an existing user account identified by username. Supply username and the fields to store in the optional user object when changing account, contact, credential, or status information.

1 parameter · 8 body fields
usernamestringrequired
The username identifying the user to update.

Optional user object containing the replacement account details.

idintegeroptional
The user's numeric identifier in int64 format.
usernamestringoptional
The user's login name.
firstNamestringoptional
The user's first name.
lastNamestringoptional
The user's last name.
emailstringoptional
The user's email address.
passwordstringoptional
The user's password.
phonestringoptional
The user's telephone number.
userStatusintegeroptional
User Status

4 status codes
200Confirms that the user was updated successfully.
400Returned when the update request is invalid.
404Returned when no user exists with the supplied username.
defaultUnexpected error

Error handling

A 400 is returned when the update request is invalid. A 404 is returned when no user exists for username; the body fields must use the declared string or integer formats, including int64 for id and int32 for userStatus.