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.

Introduction

This API is documented in OpenAPI format and is based on Petstore sample provided by swagger.io team. It was extended to illustrate features of generator-openapi-repo tool and ReDoc documentation. In addition to standard OpenAPI syntax we use a few vendor extensions.

OpenAPI Specification

This API is documented in OpenAPI format and is based on Petstore sample provided by swagger.io team. It was extended to illustrate features of generator-openapi-repo tool and ReDoc documentation. In addition to standard OpenAPI syntax we use a few vendor extensions.

Cross-Origin Resource Sharing

This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with W3C spec. And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.

Authentication

Petstore offers two forms of authentication:

  • API Key
  • OAuth2 OAuth2 - an open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications.

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

pet

Everything about your Pets

Operations

Add a new pet to the store

Request

Add new pet to the store inventory.

Cookies
cookieParaminteger(int64)required

Some cookie

Headers
Accept-Languagestring

The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US

Default en-AU
Example:

en-US

Bodyrequired

Pet object that needs to be added to the store

categoryobject

Categories this pet belongs to

namestringrequired

The name given to a pet

Example:

"Guru"

photoUrlsArray of strings(url)<= 20 itemsrequired

The list of URL to a cute photos featuring pet

friendobjectRecursive
tagsArray of objects(Tag)non-empty

Tags attached to the pet

statusstring

Pet status in the store

Enum"available""pending""sold"
petTypestring

Type of a pet

Discriminator
huntingSkillstringrequired

The measured skill for hunting

Default "lazy"
Enum"clueless""lazy""adventurous""aggressive"
Example:

"adventurous"

curl -i -X POST \
  https://redocly.com/_mock/docs/openapi/petstore/pet \
  -H 'Accept-Language: en-AU' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -b cookieParam=0 \
  -d '{
    "category": {
      "name": "string",
      "sub": {
        "prop1": "string"
      }
    },
    "name": "Guru",
    "photoUrls": [
      "string"
    ],
    "friend": {},
    "tags": [
      {
        "name": "string"
      }
    ],
    "status": "available",
    "petType": "cat",
    "huntingSkill": "adventurous"
  }'
Experience it firsthand in the API Explorer!

Responses

Invalid input

Update an existing pet

Request

Cookies
cookieParaminteger(int64)required

Some cookie

Headers
Accept-Languagestring

The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US

Default en-AU
Example:

en-US

Bodyrequired

Pet object that needs to be added to the store

categoryobject

Categories this pet belongs to

namestringrequired

The name given to a pet

Example:

"Guru"

photoUrlsArray of strings(url)<= 20 itemsrequired

The list of URL to a cute photos featuring pet

friendobjectRecursive
tagsArray of objects(Tag)non-empty

Tags attached to the pet

statusstring

Pet status in the store

Enum"available""pending""sold"
petTypestring

Type of a pet

Discriminator
huntingSkillstringrequired

The measured skill for hunting

Default "lazy"
Enum"clueless""lazy""adventurous""aggressive"
Example:

"adventurous"

curl -i -X PUT \
  https://redocly.com/_mock/docs/openapi/petstore/pet \
  -H 'Accept-Language: en-AU' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -b cookieParam=0 \
  -d '{
    "category": {
      "name": "string",
      "sub": {
        "prop1": "string"
      }
    },
    "name": "Guru",
    "photoUrls": [
      "string"
    ],
    "friend": {},
    "tags": [
      {
        "name": "string"
      }
    ],
    "status": "available",
    "petType": "cat",
    "huntingSkill": "adventurous"
  }'
Experience it firsthand in the API Explorer!

Responses

Invalid ID supplied

Find pet by ID

Request

Returns a single pet

Path
petIdinteger(int64)Deprecatedrequired

ID of pet to return

curl -i -X GET \
  'https://redocly.com/_mock/docs/openapi/petstore/pet/{petId}' \
  -H 'api_key: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

successful operation

Body
idinteger(int64)read-only

Pet ID

categoryobject

Categories this pet belongs to

namestringrequired

The name given to a pet

Example:

"Guru"

photoUrlsArray of strings(url)<= 20 itemsrequired

The list of URL to a cute photos featuring pet

friendobjectRecursive
tagsArray of objects(Tag)non-empty

Tags attached to the pet

statusstring

Pet status in the store

Enum"available""pending""sold"
petTypestring

Type of a pet

Discriminator
huntingSkillstringrequired

The measured skill for hunting

Default "lazy"
Enum"clueless""lazy""adventurous""aggressive"
Example:

"adventurous"

Response
{ "id": 0, "category": { "id": 0, "name": "string", "sub": {} }, "name": "Guru", "photoUrls": [ "string" ], "friend": {}, "tags": [ {} ], "status": "available", "petType": "cat", "huntingSkill": "adventurous" }

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/docs/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

Invalid input

Deletes a pet

Request

Path
petIdinteger(int64)required

Pet id to delete

Headers
api_keystring
Example:

Bearer <TOKEN>

curl -i -X DELETE \
  'https://redocly.com/_mock/docs/openapi/petstore/pet/{petId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'api_key: string'
Experience it firsthand in the API Explorer!

Responses

Invalid pet value

uploads an image

Request

Path
petIdinteger(int64)required

ID of pet to update

Bodyapplication/octet-stream
string(binary)
curl -i -X POST \
  'https://redocly.com/_mock/docs/openapi/petstore/pet/{petId}/uploadImage' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/octet-stream' \
  -d 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 status

Request

Multiple status values can be provided with comma separated strings

Query
statusArray of strings[ 1 .. 3 ] itemsrequired

Status values that need to be considered for filter

Items Enum"available""pending""sold"
curl -i -X GET \
  'https://redocly.com/_mock/docs/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)read-only

Pet ID

categoryobject

Categories this pet belongs to

namestringrequired

The name given to a pet

Example:

"Guru"

photoUrlsArray of strings(url)<= 20 itemsrequired

The list of URL to a cute photos featuring pet

friendobjectRecursive
tagsArray of objects(Tag)non-empty

Tags attached to the pet

statusstring

Pet status in the store

Enum"available""pending""sold"
petTypestring

Type of a pet

Discriminator
huntingSkillstringrequired

The measured skill for hunting

Default "lazy"
Enum"clueless""lazy""adventurous""aggressive"
Example:

"adventurous"

]
Response
[ { "id": 0, "category": {}, "name": "Guru", "photoUrls": [], "friend": {}, "tags": [], "status": "available", "petType": "string" } ]

Finds Pets by tagsDeprecated

Request

Multiple 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/docs/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)read-only

Pet ID

categoryobject

Categories this pet belongs to

namestringrequired

The name given to a pet

Example:

"Guru"

photoUrlsArray of strings(url)<= 20 itemsrequired

The list of URL to a cute photos featuring pet

friendobjectRecursive
tagsArray of objects(Tag)non-empty

Tags attached to the pet

statusstring

Pet status in the store

Enum"available""pending""sold"
petTypestring

Type of a pet

Discriminator
huntingSkillstringrequired

The measured skill for hunting

Default "lazy"
Enum"clueless""lazy""adventurous""aggressive"
Example:

"adventurous"

]
Response
[ { "id": 0, "category": {}, "name": "Guru", "photoUrls": [], "friend": {}, "tags": [], "status": "available", "petType": "string" } ]

store

Access to Petstore orders

Operations

user

Operations about user

Operations

The Pet Model

The Order Model