Users
Create a user
Create one Petstore user from a User payload.
Creates one user and returns a User object. The operation declares no security requirement. This example uses JSON; the contract also accepts XML and form-encoded bodies.
Create one user.
POST
/userUser identifier.
Username.
First name.
Last name.
Email address.
Password.
Phone value.
User status.
Response
{200}Successful operation
cURL
curl --request POST \
--url https://petstore3.swagger.io/api/v3/user \
--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
}'{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@example.com",
"password": "example-password",
"phone": "5550100",
"userStatus": 1
}The request body and all User properties are optional in the contract. Although the operation 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.