API Academy
🌐 English
  • 🌐 English
  • 🌐 繁體中文
HomePetstore APIExplore more APIs
HomePetstore APIExplore more APIs
🌐 English
  • 🌐 English
  • 🌐 繁體中文
🌐 English
  • 🌐 English
  • 🌐 繁體中文
  1. Pet
  • Introduction
  • Table of Contents
  • API Academy
    • Get Started
      • What is an API?
      • How Does an API Work?
      • How to Call an API?
      • How to Read an API Documentation?
      • Chapter Summary
      • Get realtime weather
    • API Fundamentals
      • API Funtamentals: Overview
      • Method & Path
      • Parameters
      • Request Body
      • Responses
      • API Specification & OAS
      • Chapter Summary
    • Working with APIs
      • Working with APIs: Overview
      • Making Requests from Spec
      • Environments and Variables
      • Chaining Multiple Endpoints
      • Handling Authentication
      • Handling API Signatures
      • Introduction to Scripts
      • Chapter Summary
    • Mocking APIs
      • Mocking APIs: Overview
      • Smart Mock
      • Mock Expectations
      • Cloud Mock
      • Mock Scripts
      • Chapter Summary
    • Designing APIs
      • Designing APIs: Overview
      • Introduction to API Design
      • Creating Your First API Project
      • Analyzing Requirements and Planning Your API
      • Designing Data Models
      • Designing Endpoints
      • Using Components and Reusability
      • Setting Up Authentication
      • API Design Guidelines
      • Chapter Summary
    • Developing APIs
      • Developing APIs: Overview
      • Setup: Install Your AI Coding Assistant
      • Quick Start: From Spec to Running API in 30 Minutes
      • Understanding the Generated Code
      • Testing Your API with Apidog
      • Deployment: Put Your API Online
      • Chapter Summary
    • Testing APIs
      • Testing APIs: Overview
      • Getting Started: Your First Test Scenario
      • Integration Testing and Data Passing
      • Dynamic Values
      • Assertions and Validations
      • Flow Control: If, For, ForEach
      • Data-Driven Testing
      • Performance Testing
      • Test Reports and Analysis
      • CI/CD Integration
      • Scheduled Tasks and Automation
      • Advanced Testing Strategies
      • Chapter Summary
    • API Documentations
      • API Documentations: Overview
      • Publishing Your First API Doc
      • Customizing Documentation Appearance
      • Interactive Features for Consumers
      • Advanced Publishing Settings
      • Managing API Versions
      • Chapter Summary
    • Advanced API Technologies
      • API Technologies: Overview
      • GraphQL
      • gRPC
      • WebSocket
      • Socket.IO
      • Server-Sent Events (SSE)
      • SOAP
      • Chapter Summary
    • API Lifecycle
      • API Lifecycle: Overview
      • Stages of the API Lifecycle
      • API Governance
      • API Security Best Practices
      • Monitoring and Analytics
      • API Versioning Strategies
      • The Future of APIs
      • Chapter Summary
    • API Security
      • API Security: Overview
      • API Security Fundamentals
      • Authentication vs Authorization
      • Understanding OAuth 2.0 and OpenID Connect
      • JSON Web Tokens (JWT)
      • OWASP API Security Top 10
      • Encryption and HTTPS
      • Chapter Summary
    • API Tools
      • API Tools: Overview
      • The Evolution of API Tools
      • API Clients
      • Command Line Tools (cURL, HTTPie)
      • API Design and Documentation Tools
      • API Mocking Tools
      • API Testing Tools
      • All-in-One API Platforms
      • Chapter Summary
    • API Gateway
      • API Gateway: Overview
      • What is an API Gateway?
      • Key Features of API Gateways
      • API Gateway vs Load Balancer vs Service Mesh
      • Popular API Gateway Solutions
      • The BFF (Backend for Frontend) Pattern
      • Chapter Summary
  • Modern Pet Store
    • Pet
      • Get Pet
        GET
      • Update Pet
        PUT
      • Delete Pet
        DELETE
      • Create Pet
        POST
      • List Pets
        GET
      • Upload Pet Image
        POST
    • User
      • Update User
      • Get User
      • Delete User
      • Login
      • Logout
      • Create User
    • Store
      • List Inventory
      • Create Order
      • Get Order
      • Delete Order
      • Callback Example
      • Pay for an Order
    • Payments
      • Pay Order
    • Chat
      • Create Chat Completion
    • Webhooks
      • Pet Adopted Event
      • New Pet Available Event
  • Schemas
    • Pet
    • Category
    • User
    • ApiResponse
    • OrderPayment
    • Tag
    • Order
    • Links-Order
    • PetCollection
    • Bank Card
    • Bank Account
    • Links
    • Error
HomePetstore APIExplore more APIs
HomePetstore APIExplore more APIs
🌐 English
  • 🌐 English
  • 🌐 繁體中文
🌐 English
  • 🌐 English
  • 🌐 繁體中文
  1. Pet

Update Pet

Production server
https://api.petstoreapi.com/v1
Production server
https://api.petstoreapi.com/v1
PUT
/pets/{id}
Update information for an existing pet. Staff only.

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
OAuth 2.0
Authorization Code
deviceCode
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Authorize URL: https://auth.petstoreapi.com/authorize
Token URL: https://auth.petstoreapi.com/token
Refresh URL: https://auth.petstoreapi.com/refresh
Scopes:
write:pets-Create and update pets
or
Path Params

Body Params application/jsonRequired

Examples

Responses

🟒200OK
application/json
Pet updated successfully
Headers

Body

🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Not Found
🟠422Too Many Requests
🟠429Internal Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://api.petstoreapi.com/v1/pets/' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "species": "DOG",
    "name": "Whiskers",
    "breed": "Domestic Shorthair",
    "ageMonths": 18,
    "size": "SMALL",
    "color": "Orange Tabby",
    "gender": "MALE",
    "goodWithKids": true,
    "goodWithPets": true,
    "adoptionFee": 75,
    "description": "string",
    "status": "AVAILABLE",
    "photos": [
        "http://example.com"
    ],
    "medicalInfo": {
        "spayedNeutered": true,
        "vaccinated": true,
        "microchipped": true,
        "specialNeeds": true,
        "notes": "string"
    }
}'
Response Response Example
200 - Example 1
{
    "id": "pet_1Nv0FGQ9RKHgCVdK",
    "species": "DOG",
    "name": "Whiskers",
    "breed": "Domestic Shorthair",
    "ageMonths": 18,
    "size": "SMALL",
    "color": "Orange Tabby",
    "gender": "MALE",
    "goodWithKids": true,
    "goodWithPets": true,
    "adoptionFee": 75,
    "description": "string",
    "status": "AVAILABLE",
    "intakeDate": "2019-08-24",
    "photos": [
        "http://example.com"
    ],
    "medicalInfo": {
        "spayedNeutered": true,
        "vaccinated": true,
        "microchipped": true,
        "specialNeeds": true,
        "notes": "string"
    },
    "links": {
        "self": "http://example.com",
        "adopt": "http://example.com"
    }
}
Modified atΒ 2025-12-19 04:10:36
Previous
Get Pet
Next
Delete Pet
Built with