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"
  }'
Experience it firsthand in the API Explorer!

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"
  }'
Experience it firsthand in the API Explorer!

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>'
Experience it firsthand in the API Explorer!

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
No response example

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'
Experience it firsthand in the API Explorer!

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
No response example

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
Experience it firsthand in the API Explorer!

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'
Experience it firsthand in the API Explorer!

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

curl -i -X POST \
  'https://redocly.com/_mock/openapi/petstore/pet/{petId}/uploadImage' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -F additionalMetadata=string \
  -F file=string
Experience it firsthand in the API Explorer!

Responses

successful operation

Bodyapplication/json
codeinteger(int32)
typestring
messagestring
Response
application/json
{ "code": 0, "type": "string", "message": "string" }

Finds Pets by tagsDeprecated

Request

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

Query
tagsArray of stringsrequired

Tags to filter by

curl -i -X GET \
  'https://redocly.com/_mock/openapi/petstore/pet/findByTags?tags=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Experience it firsthand in the API Explorer!

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
No response example

store

Access to Petstore orders

Operations

user

Operations about user

Operations