PetstoreAPI Docs
Modern Petstore APIClassic Petstore APIBlog
Modern Petstore APIClassic Petstore APIBlog
  1. pet
  • pet
    • Update an existing pet.
      PUT
    • Add a new pet to the store.
      POST
    • Finds Pets by status.
      GET
    • Finds Pets by tags.
      GET
    • Find pet by ID.
      GET
    • Updates a pet in the store with form data.
      POST
    • Deletes a pet.
      DELETE
    • Uploads an image.
      POST
  • store
    • Returns pet inventories by status.
      GET
    • Place an order for a pet.
      POST
    • Find purchase order by ID.
      GET
    • Delete purchase order by identifier.
      DELETE
  • user
    • Create user.
      POST
    • Creates list of users with given input array.
      POST
    • Logs user into the system.
      GET
    • Logs out current logged in user session.
      GET
    • Get user by user name.
      GET
    • Update user resource.
      PUT
    • Delete user resource.
      DELETE
  • Schemas
    • Schemas
      • Order
      • Category
      • User
      • Tag
      • Pet
      • ApiResponse
    • RequestBodies
      • UserArray
Modern Petstore APIClassic Petstore APIBlog
Modern Petstore APIClassic Petstore APIBlog
  1. pet

Update an existing pet.

PUT
/pet
Update an existing pet by Id.

Request

Authorization
OAuth 2.0
Implicit
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Authorize URL: https://petstore3.swagger.io/oauth/authorize
Scopes:
write:pets-modify pets in your account
read:pets-read your pets
or
Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Successful operation
Body

🟢200
🟠400
🟠404
🟠422
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT '/pet' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": 10,
    "name": "doggie",
    "category": {
        "id": 1,
        "name": "Dogs"
    },
    "photoUrls": [
        "string"
    ],
    "tags": [
        {
            "id": 0,
            "name": "string"
        }
    ],
    "status": "available"
}'
Response Response Example
{
    "id": 10,
    "name": "doggie",
    "category": {
        "id": 1,
        "name": "Dogs"
    },
    "photoUrls": [
        "string"
    ],
    "tags": [
        {
            "id": 0,
            "name": "string"
        }
    ],
    "status": "available"
}
Modified at 2025-12-17 09:17:20
Next
Add a new pet to the store.
Built with