Unfortunately, this feature is not supported on mobile devices. For the best experience, please use a computer.

Swagger Petstore (1.0.0)

This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key special-key to test the authorization filters.

Download OpenAPI description
Languages
Servers
Mock server
https://redocly.com/_mock/openapi/petstore/
https://petstore.swagger.io/v2/

pet

Everything about your Pets

Operations

store

Access to Petstore orders

Operations

user

Operations about user

Operations

Create user

Request

This can only be done by the logged in user.

Bodyapplication/jsonrequired

Created user object

idinteger(int64)
usernamestring
firstNamestring
lastNamestring
emailstring
passwordstring
phonestring
userStatusinteger(int32)

User Status

curl -i -X POST \
  https://redocly.com/_mock/openapi/petstore/user \
  -H 'Content-Type: application/json' \
  -d '{
    "id": 0,
    "username": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "password": "string",
    "phone": "string",
    "userStatus": 0
  }'
Experience it firsthand in the API Explorer!

Responses

successful operation

Creates list of users with given input array

Request

Bodyapplication/jsonrequired

List of user object

Array [
idinteger(int64)
usernamestring
firstNamestring
lastNamestring
emailstring
passwordstring
phonestring
userStatusinteger(int32)

User Status

]
curl -i -X POST \
  https://redocly.com/_mock/openapi/petstore/user/createWithArray \
  -H 'Content-Type: application/json' \
  -d '{}'
Experience it firsthand in the API Explorer!

Responses

successful operation

Creates list of users with given input array

Request

Bodyapplication/jsonrequired

List of user object

Array [
idinteger(int64)
usernamestring
firstNamestring
lastNamestring
emailstring
passwordstring
phonestring
userStatusinteger(int32)

User Status

]
curl -i -X POST \
  https://redocly.com/_mock/openapi/petstore/user/createWithList \
  -H 'Content-Type: application/json' \
  -d '{}'
Experience it firsthand in the API Explorer!

Responses

successful operation

Logs user into the system

Request

Query
usernamestringrequired

The user name for login

passwordstringrequired

The password for login in clear text

curl -i -X GET \
  'https://redocly.com/_mock/openapi/petstore/user/login?password=string&username=string'
Experience it firsthand in the API Explorer!

Responses

successful operation

Headers
X-Rate-Limitinteger(int32)

calls per hour allowed by the user

X-Expires-Afterstring(date-time)

date in UTC when token expires

Body
string
Response
No response example

Logs out current logged in user session

Request

curl -i -X GET \
  https://redocly.com/_mock/openapi/petstore/user/logout
Experience it firsthand in the API Explorer!

Responses

successful operation

Get user by user name

Request

Path
usernamestringrequired

The name that needs to be fetched. Use user1 for testing.

curl -i -X GET \
  'https://redocly.com/_mock/openapi/petstore/user/{username}'
Experience it firsthand in the API Explorer!

Responses

successful operation

Body
idinteger(int64)
usernamestring
firstNamestring
lastNamestring
emailstring
passwordstring
phonestring
userStatusinteger(int32)

User Status

Response
No response example

Updated user

Request

This can only be done by the logged in user.

Path
usernamestringrequired

name that need to be updated

Bodyapplication/jsonrequired

Updated user object

idinteger(int64)
usernamestring
firstNamestring
lastNamestring
emailstring
passwordstring
phonestring
userStatusinteger(int32)

User Status

curl -i -X PUT \
  'https://redocly.com/_mock/openapi/petstore/user/{username}' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": 0,
    "username": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "password": "string",
    "phone": "string",
    "userStatus": 0
  }'
Experience it firsthand in the API Explorer!

Responses

OK

Delete user

Request

This can only be done by the logged in user.

Path
usernamestringrequired

The name that needs to be deleted

curl -i -X DELETE \
  'https://redocly.com/_mock/openapi/petstore/user/{username}'
Experience it firsthand in the API Explorer!

Responses

OK