Create a user
Create a new user account.
POST https://petstore3.swagger.io/api/v3/user
Examples
- API Key
- OAuth 2.0
cURL
POST "https://petstore3.swagger.io/api/v3/user" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "api_key: <YOUR_API_KEY>" \
-d '{
"id": 0,
"username": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"phone": "string",
"userStatus": 0
}'
cURL
POST "https://petstore3.swagger.io/api/v3/user" \
-H "accept: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"id": 0,
"username": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"phone": "string",
"userStatus": 0
}'
Responses
| Code | Description |
|---|---|
| 200 | Successful operation |
| default | Successful operation |
Response example
200: Successful operation
Response
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@email.com",
"password": "12345",
"phone": "12345",
"userStatus": 1
}
Parameters
Request body
| Name | Type | Description |
|---|---|---|
body | User object | Required. The User object to create. |