---
title: "Update an existing pet"
method: PUT
path: "/pet"
tags: ["pet"]
---

# Update an existing pet

`PUT /pet`

Update an existing pet by Id

## Request body

- Pet
  - `id` integer
  - `name` string, required
  - `category` Category
    - `id` integer
    - `name` string
  - `photoUrls` string[], required
  - `tags` Tag[]
    - `id` integer
    - `name` string
  - `status` 'available' | 'pending' | 'sold' — pet status in the store

## Response `200`

Successful operation

- Pet
  - `id` integer
  - `name` string, required
  - `category` Category
    - `id` integer
    - `name` string
  - `photoUrls` string[], required
  - `tags` Tag[]
    - `id` integer
    - `name` string
  - `status` 'available' | 'pending' | 'sold' — pet status in the store

## Other responses

- `400` — Invalid ID supplied
- `404` — Pet not found
- `405` — Validation exception

## Changes

- **2025-03-17** `d5fd36e3763a` — 2 info
  - added the non-success response with the status `405`
  - removed the non-success response with the status `422`
- **2025-03-14** `78de4368a03c` — 2 info
  - added the non-success response with the status `422`
  - removed the non-success response with the status `405`
- **2025-03-13** `887ffd0911f2` — 2 info
  - added the non-success response with the status `405`
  - removed the non-success response with the status `422`
- **2025-03-12** `253de9e0f0ae` — 3 breaking, 4 warning, 2 info
  - removed the media type `application/xml` for the response with the status `default`
  - removed the required property `name` from the response with the `default` status
  - removed the required property `photoUrls` from the response with the `default` status
  - removed the optional property `category` from the response with the `default` status
  - …5 more
- **2025-03-10** `7f5fd6699f68` — 2 info
  - added the non-success response with the status `422`
  - removed the non-success response with the status `405`

[Change history](https://skmtc.dev/swagger/apis/swagger-petstore-openapi-3-0/changes/pet/put.md)

---

[API](https://skmtc.dev/swagger/apis/swagger-petstore-openapi-3-0.md) · [All operations](https://skmtc.dev/swagger/apis/swagger-petstore-openapi-3-0/llms.txt) · [OpenAPI document](https://skmtc.dev/swagger/apis/swagger-petstore-openapi-3-0/revisions/6c2e9495e24c?raw)
