# Pets

## Update an existing pet

**put** `/pet`

Update an existing pet by Id

### Body Parameters

- `name: string`

- `photoUrls: array of string`

- `id: optional number`

- `category: optional Category`

  - `id: optional number`

  - `name: optional string`

- `status: optional "available" or "pending" or "sold"`

  pet status in the store

  - `"available"`

  - `"pending"`

  - `"sold"`

- `tags: optional array of Tag`

  - `id: optional number`

  - `name: optional string`

### Returns

- `Pet object { name, photoUrls, id, 3 more }`

  - `name: string`

  - `photoUrls: array of string`

  - `id: optional number`

  - `category: optional Category`

    - `id: optional number`

    - `name: optional string`

  - `status: optional "available" or "pending" or "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags: optional array of Tag`

    - `id: optional number`

    - `name: optional string`

### Example

```http
curl https://petstore3.swagger.io/api/v3/pet \
    -X PUT \
    -H 'Content-Type: application/json' \
    -H "api_key: $PETSTORE_API_KEY" \
    -d '{
          "name": "doggie",
          "photoUrls": [
            "string"
          ],
          "id": 10
        }'
```

#### Response

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

## Add a new pet to the store

**post** `/pet`

Add a new pet to the store

### Body Parameters

- `name: string`

- `photoUrls: array of string`

- `id: optional number`

- `category: optional Category`

  - `id: optional number`

  - `name: optional string`

- `status: optional "available" or "pending" or "sold"`

  pet status in the store

  - `"available"`

  - `"pending"`

  - `"sold"`

- `tags: optional array of Tag`

  - `id: optional number`

  - `name: optional string`

### Returns

- `Pet object { name, photoUrls, id, 3 more }`

  - `name: string`

  - `photoUrls: array of string`

  - `id: optional number`

  - `category: optional Category`

    - `id: optional number`

    - `name: optional string`

  - `status: optional "available" or "pending" or "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags: optional array of Tag`

    - `id: optional number`

    - `name: optional string`

### Example

```http
curl https://petstore3.swagger.io/api/v3/pet \
    -H 'Content-Type: application/json' \
    -H "api_key: $PETSTORE_API_KEY" \
    -d '{
          "name": "doggie",
          "photoUrls": [
            "string"
          ],
          "id": 10
        }'
```

#### Response

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

## Finds Pets by status

**get** `/pet/findByStatus`

Multiple status values can be provided with comma separated strings

### Query Parameters

- `status: optional "available" or "pending" or "sold"`

  Status values that need to be considered for filter

  - `"available"`

  - `"pending"`

  - `"sold"`

### Returns

- `name: string`

- `photoUrls: array of string`

- `id: optional number`

- `category: optional Category`

  - `id: optional number`

  - `name: optional string`

- `status: optional "available" or "pending" or "sold"`

  pet status in the store

  - `"available"`

  - `"pending"`

  - `"sold"`

- `tags: optional array of Tag`

  - `id: optional number`

  - `name: optional string`

### Example

```http
curl https://petstore3.swagger.io/api/v3/pet/findByStatus \
    -H "api_key: $PETSTORE_API_KEY"
```

#### Response

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

## Finds Pets by tags

**get** `/pet/findByTags`

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

### Query Parameters

- `tags: optional array of string`

  Tags to filter by

### Returns

- `name: string`

- `photoUrls: array of string`

- `id: optional number`

- `category: optional Category`

  - `id: optional number`

  - `name: optional string`

- `status: optional "available" or "pending" or "sold"`

  pet status in the store

  - `"available"`

  - `"pending"`

  - `"sold"`

- `tags: optional array of Tag`

  - `id: optional number`

  - `name: optional string`

### Example

```http
curl https://petstore3.swagger.io/api/v3/pet/findByTags \
    -H "api_key: $PETSTORE_API_KEY"
```

#### Response

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

## Find pet by ID

**get** `/pet/{petId}`

Returns a single pet

### Path Parameters

- `petId: number`

### Returns

- `Pet object { name, photoUrls, id, 3 more }`

  - `name: string`

  - `photoUrls: array of string`

  - `id: optional number`

  - `category: optional Category`

    - `id: optional number`

    - `name: optional string`

  - `status: optional "available" or "pending" or "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags: optional array of Tag`

    - `id: optional number`

    - `name: optional string`

### Example

```http
curl https://petstore3.swagger.io/api/v3/pet/$PET_ID \
    -H "api_key: $PETSTORE_API_KEY"
```

#### Response

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

## Updates a pet in the store with form data

**post** `/pet/{petId}`

Updates a pet in the store with form data

### Path Parameters

- `petId: number`

### Query Parameters

- `name: optional string`

  Name of pet that needs to be updated

- `status: optional string`

  Status of pet that needs to be updated

### Example

```http
curl https://petstore3.swagger.io/api/v3/pet/$PET_ID \
    -X POST \
    -H "api_key: $PETSTORE_API_KEY"
```

## Deletes a pet

**delete** `/pet/{petId}`

delete a pet

### Path Parameters

- `petId: number`

### Example

```http
curl https://petstore3.swagger.io/api/v3/pet/$PET_ID \
    -X DELETE \
    -H "api_key: $PETSTORE_API_KEY"
```

## uploads an image

**post** `/pet/{petId}/uploadImage`

uploads an image

### Path Parameters

- `petId: number`

### Query Parameters

- `additionalMetadata: optional string`

  Additional Metadata

### Returns

- `code: optional number`

- `message: optional string`

- `type: optional string`

### Example

```http
curl https://petstore3.swagger.io/api/v3/pet/$PET_ID/uploadImage \
    -H 'Content-Type: application/octet-stream' \
    -H "api_key: $PETSTORE_API_KEY" \
    -F 'image=@/path/to/image'
```

#### Response

```json
{
  "code": 0,
  "message": "message",
  "type": "type"
}
```

## Domain Types

### Category

- `Category object { id, name }`

  - `id: optional number`

  - `name: optional string`

### Pet

- `Pet object { name, photoUrls, id, 3 more }`

  - `name: string`

  - `photoUrls: array of string`

  - `id: optional number`

  - `category: optional Category`

    - `id: optional number`

    - `name: optional string`

  - `status: optional "available" or "pending" or "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags: optional array of Tag`

    - `id: optional number`

    - `name: optional string`

### Tag

- `Tag object { id, name }`

  - `id: optional number`

  - `name: optional string`

### Pet Find By Status Response

- `PetFindByStatusResponse = array of Pet`

  - `name: string`

  - `photoUrls: array of string`

  - `id: optional number`

  - `category: optional Category`

    - `id: optional number`

    - `name: optional string`

  - `status: optional "available" or "pending" or "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags: optional array of Tag`

    - `id: optional number`

    - `name: optional string`

### Pet Find By Tags Response

- `PetFindByTagsResponse = array of Pet`

  - `name: string`

  - `photoUrls: array of string`

  - `id: optional number`

  - `category: optional Category`

    - `id: optional number`

    - `name: optional string`

  - `status: optional "available" or "pending" or "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags: optional array of Tag`

    - `id: optional number`

    - `name: optional string`

### Pet Upload Image Response

- `PetUploadImageResponse object { code, message, type }`

  - `code: optional number`

  - `message: optional string`

  - `type: optional string`
