---
title: "Updates a pet in the store with form data."
method: POST
path: "/pet/{petId}"
tags: ["pet"]
---

# Updates a pet in the store with form data.

`POST /pet/{petId}`

Updates a pet resource based on the form data.

## Path parameters

- `petId` integer, required

## Query parameters

- `name` string
- `status` string

## 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 input
- `default` — Unexpected error

## Changes

- **2025-03-19** `1315ee0b6b7e` — 3 info
  - added the non-success response with the status `400`
  - removed the non-success response with the status `405`
  - added the success response with the status `200`
- **2025-03-17** `d5fd36e3763a` — 1 breaking, 2 info
  - removed the success response with the status `200`
  - added the non-success response with the status `405`
  - removed the non-success response with the status `400`
- **2025-03-14** `78de4368a03c` — 3 info
  - added the non-success response with the status `400`
  - removed the non-success response with the status `405`
  - added the success response with the status `200`
- **2025-03-13** `887ffd0911f2` — 1 breaking, 2 info
  - removed the success response with the status `200`
  - added the non-success response with the status `405`
  - removed the non-success response with the status `400`
- **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

[Full history](https://skmtc.dev/swagger/apis/swagger-petstore-openapi-3-0/changes/pet/:petId/post.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-service-production.skmtc.workers.dev/v1/apis/swagger/swagger-petstore-openapi-3-0/revisions/e1a2480ffa44/schema)
