pet

pet

uploads an image

Path Parameters
  • petId
    required

    ID of pet to update

Form Data
  • additionalMetadata

    Additional data to pass to server

  • file

    file to upload

Responses
  • 200

    successful operation

POST/pet/{petId}/uploadImage
curl https://petstore.swagger.io/v2/pet//uploadImage \
  --request POST \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data "additionalMetadata=&file="
{
  "code": 1,
  "type": "…",
  "message": "…"
}

Add a new pet to the store

Body Parameters
  • body
    object
    required
Responses
  • 405

    Invalid input

POST/pet
curl https://petstore.swagger.io/v2/pet \
  --request POST \
  --header 'Content-Type: text/plain;charset=UTF-8' \
  --data "{
  "id": 1,
  "category": {
    "id": 1,
    "name": ""
  },
  "name": "doggie",
  "photoUrls": [
    ""
  ],
  "tags": [
    {
      "id": 1,
      "name": ""
    }
  ],
  "status": "available"
}"
No Body

Update an existing pet

Body Parameters
  • body
    object
    required
Responses
  • 400

    Invalid ID supplied

  • 404

    Pet not found

  • 405

    Validation exception

PUT/pet
curl https://petstore.swagger.io/v2/pet \
  --request PUT \
  --header 'Content-Type: text/plain;charset=UTF-8' \
  --data "{
  "id": 1,
  "category": {
    "id": 1,
    "name": ""
  },
  "name": "doggie",
  "photoUrls": [
    ""
  ],
  "tags": [
    {
      "id": 1,
      "name": ""
    }
  ],
  "status": "available"
}"
No Body

Finds Pets by status

Multiple status values can be provided with comma separated strings

Query Parameters
  • status
    required

    Status values that need to be considered for filter

Responses
  • 200

    successful operation

  • 400

    Invalid status value

GET/pet/findByStatus
curl https://petstore.swagger.io/v2/pet/findByStatus
[
  {
    "id": 1,
    "category": {
      "id": 1,
      "name": "…"
    },
    "name": "doggie",
    "photoUrls": [
      "…"
    ],
    "tags": [
      {
        "id": 1,
        "name": "…"
      }
    ],
    "status": "available"
  }
]
Deprecated

Finds Pets by tags

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

Query Parameters
  • tags
    required

    Tags to filter by

Responses
  • 200

    successful operation

  • 400

    Invalid tag value

GET/pet/findByTags
curl https://petstore.swagger.io/v2/pet/findByTags
[
  {
    "id": 1,
    "category": {
      "id": 1,
      "name": "…"
    },
    "name": "doggie",
    "photoUrls": [
      "…"
    ],
    "tags": [
      {
        "id": 1,
        "name": "…"
      }
    ],
    "status": "available"
  }
]

Find pet by ID

Returns a single pet

Path Parameters
  • petId
    required

    ID of pet to return

Responses
  • 200

    successful operation

  • 400

    Invalid ID supplied

  • 404

    Pet not found

GET/pet/{petId}
curl https://petstore.swagger.io/v2/pet/ \
  --header 'Api_key: YOUR_SECRET_TOKEN'
{
  "id": 1,
  "category": {
    "id": 1,
    "name": "…"
  },
  "name": "doggie",
  "photoUrls": [
    "…"
  ],
  "tags": [
    {
      "id": 1,
      "name": "…"
    }
  ],
  "status": "available"
}

Updates a pet in the store with form data

Path Parameters
  • petId
    required

    ID of pet that needs to be updated

Form Data
  • name

    Updated name of the pet

  • status

    Updated status of the pet

Responses
  • 405

    Invalid input

POST/pet/{petId}
curl https://petstore.swagger.io/v2/pet/ \
  --request POST \
  --header 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' \
  --data "name=&status="
No Body

Deletes a pet

Path Parameters
  • petId
    required

    Pet id to delete

Headers
  • api_key
Responses
  • 400

    Invalid ID supplied

  • 404

    Pet not found

DELETE/pet/{petId}
curl https://petstore.swagger.io/v2/pet/ \
  --request DELETE \
  --header 'Content-Type: text/plain;charset=UTF-8' \
  --data ""
No Body