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

Add a new pet to the store

Request

Bodyrequired

Pet object that needs to be added to the store

idinteger(int64)
categoryobject(Category)
namestringrequired
Example:

"doggie"

photoUrlsArray of stringsrequired
tagsArray of objects(Tag)
statusstring

pet status in the store

Enum"available""pending""sold"
curl -i -X POST \
  https://redocly.com/_mock/openapi/petstore/pet \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": 0,
    "category": {
      "id": 0,
      "name": "string"
    },
    "name": "doggie",
    "photoUrls": [
      "string"
    ],
    "tags": [
      {
        "id": 0,
        "name": "string"
      }
    ],
    "status": "available"
  }'

Responses

OK

Update an existing pet

Request

Bodyrequired

Pet object that needs to be added to the store

idinteger(int64)
categoryobject(Category)
namestringrequired
Example:

"doggie"

photoUrlsArray of stringsrequired
tagsArray of objects(Tag)
statusstring

pet status in the store

Enum"available""pending""sold"
curl -i -X PUT \
  https://redocly.com/_mock/openapi/petstore/pet \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": 0,
    "category": {
      "id": 0,
      "name": "string"
    },
    "name": "doggie",
    "photoUrls": [
      "string"
    ],
    "tags": [
      {
        "id": 0,
        "name": "string"
      }
    ],
    "status": "available"
  }'

Responses

OK

Finds Pets by status

Request

Multiple status values can be provided with comma separated strings

Query
statusArray of stringsrequired

Status values that need to be considered for filter

Items Enum"available""pending""sold"
curl -i -X GET \
  'https://redocly.com/_mock/openapi/petstore/pet/findByStatus?status=available' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

successful operation

BodyArray [
idinteger(int64)
categoryobject(Category)
namestringrequired
Example:

"doggie"

photoUrlsArray of stringsrequired
tagsArray of objects(Tag)
statusstring

pet status in the store

Enum"available""pending""sold"
]
Response
<id>0</id>
<category>
    <id>0</id>
    <name>string</name>
</category>
<name>doggie</name>
<photoUrls>string</photoUrls>
<tags>
    <id>0</id>
    <name>string</name>
</tags>
<status>available</status>

Find pet by ID

Request

Returns a single pet

Path
petIdinteger(int64)required

ID of pet to return

curl -i -X GET \
  'https://redocly.com/_mock/openapi/petstore/pet/{petId}' \
  -H 'api_key: YOUR_API_KEY_HERE'

Responses

successful operation

Body
idinteger(int64)
categoryobject(Category)
namestringrequired
Example:

"doggie"

photoUrlsArray of stringsrequired
tagsArray of objects(Tag)
statusstring

pet status in the store

Enum"available""pending""sold"
Response
<id>0</id>
<category>
    <id>0</id>
    <name>string</name>
</category>
<name>doggie</name>
<photoUrls>string</photoUrls>
<tags>
    <id>0</id>
    <name>string</name>
</tags>
<status>available</status>

Updates a pet in the store with form data

Request

Path
petIdinteger(int64)required

ID of pet that needs to be updated

Bodyapplication/x-www-form-urlencoded
namestring

Updated name of the pet

statusstring

Updated status of the pet

curl -i -X POST \
  'https://redocly.com/_mock/openapi/petstore/pet/{petId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d name=string \
  -d status=string

Responses

OK

Deletes a pet

Request

Path
petIdinteger(int64)required

Pet id to delete

Headers
api_keystring
curl -i -X DELETE \
  'https://redocly.com/_mock/openapi/petstore/pet/{petId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'api_key: string'

Responses

OK

uploads an image

Request

Path
petIdinteger(int64)required

ID of pet to update

Bodymultipart/form-data
additionalMetadatastring

Additional data to pass to server

filestring(binary)

file to upload