Users
Update a user
Update a user selected by username.
Updates the user selected by the path. The operation declares no security requirement. This example uses JSON; the contract also accepts XML and form-encoded bodies.
Update a user resource.
PUT
/user/{username}Current username of the user to update.
User identifier.
Username in the updated user object.
First name.
Last name.
Email address.
Password.
Phone value.
User status.
Response
{200}Successful operation
{400}Bad request
{404}User not found
cURL
curl --request PUT \
--url https://petstore3.swagger.io/api/v3/user/theUser \
--header 'Content-Type: application/json' \
--data '{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@example.com",
"password": "example-password",
"phone": 5550100,
"userStatus": 1
}'No response body is defined by the OpenAPI contract.
The request body and all User properties are optional in the contract. Although the description refers to a logged-in user, no operation-level security scheme is declared. A default Unexpected error response is also defined without a fixed status or body schema.