curl --request PUT \
--url https://api.petstoreapi.com/v1/pets/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Max Updated",
"species": "DOG",
"breed": "Golden Retriever",
"ageMonths": 25,
"size": "LARGE",
"color": "Golden",
"gender": "MALE",
"goodWithKids": true,
"price": "275.00",
"currency": "USD",
"status": "AVAILABLE",
"description": "Friendly and well-trained golden retriever",
"medicalInfo": {
"vaccinated": true,
"spayedNeutered": true,
"microchipped": true,
"specialNeeds": false,
"healthNotes": "Up to date on all vaccinations, recent dental cleaning"
}
}
'import requests
url = "https://api.petstoreapi.com/v1/pets/{id}"
payload = {
"name": "Max Updated",
"species": "DOG",
"breed": "Golden Retriever",
"ageMonths": 25,
"size": "LARGE",
"color": "Golden",
"gender": "MALE",
"goodWithKids": True,
"price": "275.00",
"currency": "USD",
"status": "AVAILABLE",
"description": "Friendly and well-trained golden retriever",
"medicalInfo": {
"vaccinated": True,
"spayedNeutered": True,
"microchipped": True,
"specialNeeds": False,
"healthNotes": "Up to date on all vaccinations, recent dental cleaning"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Max Updated',
species: 'DOG',
breed: 'Golden Retriever',
ageMonths: 25,
size: 'LARGE',
color: 'Golden',
gender: 'MALE',
goodWithKids: true,
price: '275.00',
currency: 'USD',
status: 'AVAILABLE',
description: 'Friendly and well-trained golden retriever',
medicalInfo: {
vaccinated: true,
spayedNeutered: true,
microchipped: true,
specialNeeds: false,
healthNotes: 'Up to date on all vaccinations, recent dental cleaning'
}
})
};
fetch('https://api.petstoreapi.com/v1/pets/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.petstoreapi.com/v1/pets/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Max Updated',
'species' => 'DOG',
'breed' => 'Golden Retriever',
'ageMonths' => 25,
'size' => 'LARGE',
'color' => 'Golden',
'gender' => 'MALE',
'goodWithKids' => true,
'price' => '275.00',
'currency' => 'USD',
'status' => 'AVAILABLE',
'description' => 'Friendly and well-trained golden retriever',
'medicalInfo' => [
'vaccinated' => true,
'spayedNeutered' => true,
'microchipped' => true,
'specialNeeds' => false,
'healthNotes' => 'Up to date on all vaccinations, recent dental cleaning'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.petstoreapi.com/v1/pets/{id}"
payload := strings.NewReader("{\n \"name\": \"Max Updated\",\n \"species\": \"DOG\",\n \"breed\": \"Golden Retriever\",\n \"ageMonths\": 25,\n \"size\": \"LARGE\",\n \"color\": \"Golden\",\n \"gender\": \"MALE\",\n \"goodWithKids\": true,\n \"price\": \"275.00\",\n \"currency\": \"USD\",\n \"status\": \"AVAILABLE\",\n \"description\": \"Friendly and well-trained golden retriever\",\n \"medicalInfo\": {\n \"vaccinated\": true,\n \"spayedNeutered\": true,\n \"microchipped\": true,\n \"specialNeeds\": false,\n \"healthNotes\": \"Up to date on all vaccinations, recent dental cleaning\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.petstoreapi.com/v1/pets/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Max Updated\",\n \"species\": \"DOG\",\n \"breed\": \"Golden Retriever\",\n \"ageMonths\": 25,\n \"size\": \"LARGE\",\n \"color\": \"Golden\",\n \"gender\": \"MALE\",\n \"goodWithKids\": true,\n \"price\": \"275.00\",\n \"currency\": \"USD\",\n \"status\": \"AVAILABLE\",\n \"description\": \"Friendly and well-trained golden retriever\",\n \"medicalInfo\": {\n \"vaccinated\": true,\n \"spayedNeutered\": true,\n \"microchipped\": true,\n \"specialNeeds\": false,\n \"healthNotes\": \"Up to date on all vaccinations, recent dental cleaning\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.petstoreapi.com/v1/pets/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Max Updated\",\n \"species\": \"DOG\",\n \"breed\": \"Golden Retriever\",\n \"ageMonths\": 25,\n \"size\": \"LARGE\",\n \"color\": \"Golden\",\n \"gender\": \"MALE\",\n \"goodWithKids\": true,\n \"price\": \"275.00\",\n \"currency\": \"USD\",\n \"status\": \"AVAILABLE\",\n \"description\": \"Friendly and well-trained golden retriever\",\n \"medicalInfo\": {\n \"vaccinated\": true,\n \"spayedNeutered\": true,\n \"microchipped\": true,\n \"specialNeeds\": false,\n \"healthNotes\": \"Up to date on all vaccinations, recent dental cleaning\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "019b4132-70aa-764f-b315-e2803d882a24",
"species": "DOG",
"name": "Whiskers",
"ageMonths": 18,
"price": "75.00",
"currency": "USD",
"status": "AVAILABLE",
"createdAt": "2025-12-21T13:56:23Z",
"updatedAt": "2025-12-21T13:56:23Z",
"breed": "Domestic Shorthair",
"size": "SMALL",
"color": "Orange Tabby",
"gender": "MALE",
"goodWithKids": true,
"description": "<string>",
"tenantId": "550e8400-e29b-41d4-a716-446655440000",
"photos": [
"<string>"
],
"medicalInfo": {
"spayedNeutered": true,
"vaccinated": true,
"microchipped": true,
"specialNeeds": true,
"healthNotes": "<string>"
}
}{
"type": "https://petstoreapi.com/errors/bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid value for parameter 'status'. Must be one of: available, pending, sold.",
"instance": "/pets"
}{
"type": "https://petstoreapi.com/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Authentication is required to access this resource. Please provide a valid OAuth 2.0 token."
}{
"type": "https://petstoreapi.com/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "You do not have permission to access this resource."
}{
"type": "https://petstoreapi.com/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "The requested pet with ID '123' was not found.",
"instance": "/pets/123"
}{
"type": "https://petstoreapi.com/errors/validation-error",
"title": "Validation Error",
"status": 422,
"detail": "The request body contains validation errors.",
"instance": "/pets",
"errors": [
{
"field": "name",
"message": "Pet name is required",
"code": "required_field"
},
{
"field": "status",
"message": "Invalid status value",
"code": "invalid_format"
}
]
}{
"type": "https://petstoreapi.com/errors/rate-limit-exceeded",
"title": "Too Many Requests",
"status": 429,
"detail": "Rate limit exceeded. Please wait 60 seconds before making another request."
}Update Pet
Update information for an existing pet. Staff only.
curl --request PUT \
--url https://api.petstoreapi.com/v1/pets/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Max Updated",
"species": "DOG",
"breed": "Golden Retriever",
"ageMonths": 25,
"size": "LARGE",
"color": "Golden",
"gender": "MALE",
"goodWithKids": true,
"price": "275.00",
"currency": "USD",
"status": "AVAILABLE",
"description": "Friendly and well-trained golden retriever",
"medicalInfo": {
"vaccinated": true,
"spayedNeutered": true,
"microchipped": true,
"specialNeeds": false,
"healthNotes": "Up to date on all vaccinations, recent dental cleaning"
}
}
'import requests
url = "https://api.petstoreapi.com/v1/pets/{id}"
payload = {
"name": "Max Updated",
"species": "DOG",
"breed": "Golden Retriever",
"ageMonths": 25,
"size": "LARGE",
"color": "Golden",
"gender": "MALE",
"goodWithKids": True,
"price": "275.00",
"currency": "USD",
"status": "AVAILABLE",
"description": "Friendly and well-trained golden retriever",
"medicalInfo": {
"vaccinated": True,
"spayedNeutered": True,
"microchipped": True,
"specialNeeds": False,
"healthNotes": "Up to date on all vaccinations, recent dental cleaning"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Max Updated',
species: 'DOG',
breed: 'Golden Retriever',
ageMonths: 25,
size: 'LARGE',
color: 'Golden',
gender: 'MALE',
goodWithKids: true,
price: '275.00',
currency: 'USD',
status: 'AVAILABLE',
description: 'Friendly and well-trained golden retriever',
medicalInfo: {
vaccinated: true,
spayedNeutered: true,
microchipped: true,
specialNeeds: false,
healthNotes: 'Up to date on all vaccinations, recent dental cleaning'
}
})
};
fetch('https://api.petstoreapi.com/v1/pets/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.petstoreapi.com/v1/pets/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Max Updated',
'species' => 'DOG',
'breed' => 'Golden Retriever',
'ageMonths' => 25,
'size' => 'LARGE',
'color' => 'Golden',
'gender' => 'MALE',
'goodWithKids' => true,
'price' => '275.00',
'currency' => 'USD',
'status' => 'AVAILABLE',
'description' => 'Friendly and well-trained golden retriever',
'medicalInfo' => [
'vaccinated' => true,
'spayedNeutered' => true,
'microchipped' => true,
'specialNeeds' => false,
'healthNotes' => 'Up to date on all vaccinations, recent dental cleaning'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.petstoreapi.com/v1/pets/{id}"
payload := strings.NewReader("{\n \"name\": \"Max Updated\",\n \"species\": \"DOG\",\n \"breed\": \"Golden Retriever\",\n \"ageMonths\": 25,\n \"size\": \"LARGE\",\n \"color\": \"Golden\",\n \"gender\": \"MALE\",\n \"goodWithKids\": true,\n \"price\": \"275.00\",\n \"currency\": \"USD\",\n \"status\": \"AVAILABLE\",\n \"description\": \"Friendly and well-trained golden retriever\",\n \"medicalInfo\": {\n \"vaccinated\": true,\n \"spayedNeutered\": true,\n \"microchipped\": true,\n \"specialNeeds\": false,\n \"healthNotes\": \"Up to date on all vaccinations, recent dental cleaning\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.petstoreapi.com/v1/pets/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Max Updated\",\n \"species\": \"DOG\",\n \"breed\": \"Golden Retriever\",\n \"ageMonths\": 25,\n \"size\": \"LARGE\",\n \"color\": \"Golden\",\n \"gender\": \"MALE\",\n \"goodWithKids\": true,\n \"price\": \"275.00\",\n \"currency\": \"USD\",\n \"status\": \"AVAILABLE\",\n \"description\": \"Friendly and well-trained golden retriever\",\n \"medicalInfo\": {\n \"vaccinated\": true,\n \"spayedNeutered\": true,\n \"microchipped\": true,\n \"specialNeeds\": false,\n \"healthNotes\": \"Up to date on all vaccinations, recent dental cleaning\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.petstoreapi.com/v1/pets/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Max Updated\",\n \"species\": \"DOG\",\n \"breed\": \"Golden Retriever\",\n \"ageMonths\": 25,\n \"size\": \"LARGE\",\n \"color\": \"Golden\",\n \"gender\": \"MALE\",\n \"goodWithKids\": true,\n \"price\": \"275.00\",\n \"currency\": \"USD\",\n \"status\": \"AVAILABLE\",\n \"description\": \"Friendly and well-trained golden retriever\",\n \"medicalInfo\": {\n \"vaccinated\": true,\n \"spayedNeutered\": true,\n \"microchipped\": true,\n \"specialNeeds\": false,\n \"healthNotes\": \"Up to date on all vaccinations, recent dental cleaning\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "019b4132-70aa-764f-b315-e2803d882a24",
"species": "DOG",
"name": "Whiskers",
"ageMonths": 18,
"price": "75.00",
"currency": "USD",
"status": "AVAILABLE",
"createdAt": "2025-12-21T13:56:23Z",
"updatedAt": "2025-12-21T13:56:23Z",
"breed": "Domestic Shorthair",
"size": "SMALL",
"color": "Orange Tabby",
"gender": "MALE",
"goodWithKids": true,
"description": "<string>",
"tenantId": "550e8400-e29b-41d4-a716-446655440000",
"photos": [
"<string>"
],
"medicalInfo": {
"spayedNeutered": true,
"vaccinated": true,
"microchipped": true,
"specialNeeds": true,
"healthNotes": "<string>"
}
}{
"type": "https://petstoreapi.com/errors/bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid value for parameter 'status'. Must be one of: available, pending, sold.",
"instance": "/pets"
}{
"type": "https://petstoreapi.com/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Authentication is required to access this resource. Please provide a valid OAuth 2.0 token."
}{
"type": "https://petstoreapi.com/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "You do not have permission to access this resource."
}{
"type": "https://petstoreapi.com/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "The requested pet with ID '123' was not found.",
"instance": "/pets/123"
}{
"type": "https://petstoreapi.com/errors/validation-error",
"title": "Validation Error",
"status": 422,
"detail": "The request body contains validation errors.",
"instance": "/pets",
"errors": [
{
"field": "name",
"message": "Pet name is required",
"code": "required_field"
},
{
"field": "status",
"message": "Invalid status value",
"code": "invalid_format"
}
]
}{
"type": "https://petstoreapi.com/errors/rate-limit-exceeded",
"title": "Too Many Requests",
"status": 429,
"detail": "Rate limit exceeded. Please wait 60 seconds before making another request."
}Authorizations
Bearer token authentication using JWT (JSON Web Token). Include the token in the Authorization header as: Authorization: Bearer <token>
Headers
Optional tenant identifier for data isolation. When provided, all operations will be scoped to this tenant, ensuring data separation between different organizations or users. If omitted, operations will access the shared/public data pool where data may be visible to and modified by other users.
Path Parameters
Unique identifier for the pet
Body
Animal information in the pet store available for adoption.
The species of the pet
DOG, CAT, RABBIT, BIRD, REPTILE, OTHER The pet's name
1 - 50"Whiskers"
"Max"
"Luna"
Age of the pet in months
x >= 018
36
6
Adoption fee amount
"75.00"
"150.00"
"50.00"
Currency code for the adoption fee (ISO 4217)
^[A-Z]{3}$"USD"
"EUR"
"GBP"
Current adoption status
AVAILABLE, PENDING, ADOPTED, NOT_AVAILABLE The breed of the pet
"Domestic Shorthair"
"Labrador Retriever"
"Holland Lop"
Size category of the pet
SMALL, MEDIUM, LARGE Primary color or coloring pattern
"Orange Tabby"
"Black"
"Brown and White"
The pet's gender
MALE, FEMALE, UNKNOWN Whether the pet is good with children
Detailed description of the pet's personality and traits
URLs of pet photos
Show child attributes
Show child attributes
Response
Pet updated successfully
Animal information in the pet store available for adoption.
Unique identifier for the pet (UUID v7)
"019b4132-70aa-764f-b315-e2803d882a24"
"019b4127-54d5-76d9-b626-0d4c7bfce5b6"
The species of the pet
DOG, CAT, RABBIT, BIRD, REPTILE, OTHER The pet's name
1 - 50"Whiskers"
"Max"
"Luna"
Age of the pet in months
x >= 018
36
6
Adoption fee amount
"75.00"
"150.00"
"50.00"
Currency code for the adoption fee (ISO 4217)
^[A-Z]{3}$"USD"
"EUR"
"GBP"
Current adoption status
AVAILABLE, PENDING, ADOPTED, NOT_AVAILABLE Timestamp when the pet record was created (RFC 3339)
"2025-12-21T13:56:23Z"
"2025-11-15T08:30:00Z"
Timestamp when the pet record was last updated (RFC 3339)
"2025-12-21T13:56:23Z"
"2025-12-21T15:30:45Z"
The breed of the pet
"Domestic Shorthair"
"Labrador Retriever"
"Holland Lop"
Size category of the pet
SMALL, MEDIUM, LARGE Primary color or coloring pattern
"Orange Tabby"
"Black"
"Brown and White"
The pet's gender
MALE, FEMALE, UNKNOWN Whether the pet is good with children
Detailed description of the pet's personality and traits
Optional tenant identifier for data isolation. When present, indicates this pet belongs to a specific tenant. Null or omitted means the pet is in the shared/public data pool.
"550e8400-e29b-41d4-a716-446655440000"
"7c9e6679-7425-40de-944b-e07fc1f90ae7"
URLs of pet photos
Show child attributes
Show child attributes