Swagger Petstore - OpenAPI 3.0· docs by DocoAPI
v1.0.27
POST/pet
operationId: addPet

Add a new pet to the store.

Add a new pet to the store.

🔒petstore_auth

Request Body required

application/json
NameTypeRequiredExample / Values
object
namestringrequired
Example:"doggie"
photoUrlsarray[string]required
idinteger (int64)optional
Example:10
categoryobjectoptional
idinteger (int64)optional
Example:1
namestringoptional
Example:"Dogs"
tagsarray[object]optional
Itemobject
statusstringoptional
availablependingsold

pet status in the store

Example
{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}
application/xml
NameTypeRequiredExample / Values
object
namestringrequired
Example:"doggie"
photoUrlsarray[string]required
idinteger (int64)optional
Example:10
categoryobjectoptional
idinteger (int64)optional
Example:1
namestringoptional
Example:"Dogs"
tagsarray[object]optional
Itemobject
statusstringoptional
availablependingsold

pet status in the store

Example
{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}
application/x-www-form-urlencoded
NameTypeRequiredExample / Values
object
namestringrequired
Example:"doggie"
photoUrlsarray[string]required
idinteger (int64)optional
Example:10
categoryobjectoptional
idinteger (int64)optional
Example:1
namestringoptional
Example:"Dogs"
tagsarray[object]optional
Itemobject
statusstringoptional
availablependingsold

pet status in the store

Example
{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}

Responses

200 OK — Successful operation
400 Bad Request — Invalid input
422 Unprocessable Entity — Validation exception
default — Unexpected error

⚡ Try it out