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.

Server
petstore.swagger.io
Server Variables

OAuth2 implicit authentication through a dialog

FlowImplicit
Authorization URLhttps://petstore.swagger.io/oauth/dialog
Scopes
NameDescription
read:petsRead your pets
write:petsModify pets in your account
apiKey api_key

Use your API Key provided in your Account Settings

Fields
KeyIn
api_keyHeader

Add a new pet to the store

Auth
Required Scopes:write:petsread:pets
Request Body application/json application/xml
objectobject

Pet object

idint64

Pet ID

categoryobject

Category object

idint64

Category ID

namestring

Category name

namestring

Name of the pet

photoUrlsarray[string]

Array of all photo URLs of the pet

tagsarray[object]

Tags associated with the pet

idint64

Tag ID

namestring

Tag name

statusstring

Pet status in the store

Enum: available,pending,sold

POST /pet
Copy
Responses application/xml application/json
405

Invalid input

No response body
Response
Copy

Update an existing pet

Auth
Required Scopes:write:petsread:pets
Request Body application/json application/xml
objectobject

Pet object

idint64

Pet ID

categoryobject

Category object

idint64

Category ID

namestring

Category name

namestring

Name of the pet

photoUrlsarray[string]

Array of all photo URLs of the pet

tagsarray[object]

Tags associated with the pet

idint64

Tag ID

namestring

Tag name

statusstring

Pet status in the store

Enum: available,pending,sold

PUT /pet
Copy
Responses application/xml application/json
400

Invalid ID supplied

No response body
404

Pet not found

405

Validation exception

Response
Copy

Finds Pets by status

Multiple status values can be provided with comma separated strings

Auth
Required Scopes:write:petsread:pets
Query String
statusarray

Status values that need to be considered for filter

Enum: available,pending,sold

GET /pet/findByStatus
Copy
Responses application/xml application/json
200

Successful Operation

arrayarray[object]
idint64

Pet ID

categoryobject

Category object

idint64

Category ID

namestring

Category name

namestring

Name of the pet

photoUrlsarray[string]

Array of all photo URLs of the pet

tagsarray[object]

Tags associated with the pet

idint64

Tag ID

namestring

Tag name

statusstring

Pet status in the store

Enum: available,pending,sold

400

Invalid status value

Response
Copy

Finds Pets by tagsDeprecated

Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

Auth
Required Scopes:write:petsread:pets
Query String
tagsarray

Tags to filter by

GET /pet/findByTags
Copy
Responses application/xml application/json
200

Successful Operation

arrayarray[object]
idint64

Pet ID

categoryobject

Category object

idint64

Category ID

namestring

Category name

namestring

Name of the pet

photoUrlsarray[string]

Array of all photo URLs of the pet

tagsarray[object]

Tags associated with the pet

idint64

Tag ID

namestring

Tag name

statusstring

Pet status in the store

Enum: available,pending,sold

400

Invalid tag value

Response
Copy

Find pet by ID

Returns a single pet

Auth
Path Params
petIdinteger

ID of pet to return

GET /pet/{petId}
Copy
Responses application/xml application/json
200

Successful Operation

objectobject

Pet object

idint64

Pet ID

categoryobject

Category object

idint64

Category ID

namestring

Category name

namestring

Name of the pet

photoUrlsarray[string]

Array of all photo URLs of the pet

tagsarray[object]

Tags associated with the pet

idint64

Tag ID

namestring

Tag name

statusstring

Pet status in the store

Enum: available,pending,sold

400

Invalid ID supplied

404

Pet not found

Response
Copy

Updates a pet in the store with form data

Auth
Required Scopes:write:petsread:pets
Path Params
petIdinteger

ID of pet that needs to be updated

Form Data
namestring

Updated name of the pet

statusstring

Updated status of the pet

POST /pet/{petId}
Copy
Responses application/xml application/json
405

Invalid input

No response body
Response
Copy

Deletes a pet

Auth
Required Scopes:write:petsread:pets
Headers
api_keystring
Path Params
petIdinteger

Pet ID to delete

DELETE /pet/{petId}
Copy
Responses application/xml application/json
400

Invalid ID supplied

No response body
404

Pet not found

Response
Copy

Uploads an image

Auth
Required Scopes:write:petsread:pets
Path Params
petIdinteger

ID of pet to update

Form Data
additionalMetadatastring

Additional data to pass to server

filefile

File to upload

POST /pet/{petId}/uploadImage
Copy
Responses application/json
200

Successful Operation

objectobject
codeint32

Response code

typestring

Response type

messagestring

Response message

Response
Copy

Returns pet inventories by status

Returns a map of status codes to quantities

Auth
GET /store/inventory
Copy
Responses application/json
200

Successful Operation

objectobject
*int32
Response
Copy

Place an order for a pet

Auth
Request Body
objectobject
idint64

Order ID

petIdint64

Pet ID

quantityint32

Order quantity

shipDatedate-time

Ship date

statusstring

Order Status

Enum: placed,approved,delivered

completeboolean

Is order complete?

POST /store/order
Copy
Responses application/xml application/json
200

Successful Operation

objectobject
idint64

Order ID

petIdint64

Pet ID

quantityint32

Order quantity

shipDatedate-time

Ship date

statusstring

Order Status

Enum: placed,approved,delivered

completeboolean

Is order complete?

400

Invalid Order

Response
Copy

Find purchase order by ID

For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions

Auth
Path Params
orderIdinteger

ID of pet that needs to be fetched

maximum: 10

minimum: 1

GET /store/order/{orderId}
Copy
Responses application/xml application/json
200

Successful Operation

objectobject
idint64

Order ID

petIdint64

Pet ID

quantityint32

Order quantity

shipDatedate-time

Ship date

statusstring

Order Status

Enum: placed,approved,delivered

completeboolean

Is order complete?

400

Invalid ID supplied

404

Order not found

Response
Copy

Delete purchase order by ID

For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors

Auth
Path Params
orderIdinteger

ID of the order that needs to be deleted

minimum: 1

DELETE /store/order/{orderId}
Copy
Responses application/xml application/json
400

Invalid ID supplied

No response body
404

Order not found

Response
Copy

Create user

This can only be done by the logged in user.

Auth
Request Body
objectobject

User object

idint64

User ID

usernamestring

Username

firstNamestring

First Name

lastNamestring

Last Name

emailstring

User e-mail address

passwordstring

User password

phonestring

Phone Number

userStatusint32

User Status

POST /user
Copy
Responses application/xml application/json
default

Successful Operation

No response body
Response
Copy

Creates list of users with given input array

Auth
Request Body
arrayarray[object]
idint64

User ID

usernamestring

Username

firstNamestring

First Name

lastNamestring

Last Name

emailstring

User e-mail address

passwordstring

User password

phonestring

Phone Number

userStatusint32

User Status

POST /user/createWithArray
Copy
Responses application/xml application/json
default

Successful Operation

No response body
Response
Copy

Creates list of users with given input array

Auth
Request Body
arrayarray[object]
idint64

User ID

usernamestring

Username

firstNamestring

First Name

lastNamestring

Last Name

emailstring

User e-mail address

passwordstring

User password

phonestring

Phone Number

userStatusint32

User Status

POST /user/createWithList
Copy
Responses application/xml application/json
default

Successful Operation

No response body
Response
Copy

Logs user into the system

Auth
Query String
usernamestring

The user name for login

passwordstring

The password for login in clear text

GET /user/login
Copy
Responses application/xml application/json
200

Successful Operation

Headers
Body
stringstring
400

Invalid username/password supplied

Response
Copy

Logs out current logged in user session

Auth
GET /user/logout
Copy
Responses application/xml application/json
default

Successful Operation

No response body
Response
Copy

Get user by user name

Auth
Path Params
usernamestring

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

GET /user/{username}
Copy
Responses application/xml application/json
200

Successful Operation

objectobject

User object

idint64

User ID

usernamestring

Username

firstNamestring

First Name

lastNamestring

Last Name

emailstring

User e-mail address

passwordstring

User password

phonestring

Phone Number

userStatusint32

User Status

400

Invalid username supplied

404

User not found

Response
Copy

Updated user

This can only be done by the logged in user.

Auth
Path Params
usernamestring

Name that needs to be updated

Request Body
objectobject

User object

idint64

User ID

usernamestring

Username

firstNamestring

First Name

lastNamestring

Last Name

emailstring

User e-mail address

passwordstring

User password

phonestring

Phone Number

userStatusint32

User Status

PUT /user/{username}
Copy
Responses application/xml application/json
400

Invalid user supplied

No response body
404

User not found

Response
Copy

Delete user

This can only be done by the logged in user.

Auth
Path Params
usernamestring

The name that needs to be deleted

DELETE /user/{username}
Copy
Responses application/xml application/json
400

Invalid username supplied

No response body
404

User not found

Response
Copy