PetstoreAPI Docs
Modern Petstore APIClassic Petstore APIBlog
Modern Petstore APIClassic Petstore APIBlog
  1. Pet
  • Modern Pet Store API: A New Gold Standard for OpenAPI
  • Pet
    • Get Pet
      GET
    • Update Pet
      PUT
    • Delete Pet
      DELETE
    • Create Pet
      POST
    • List Pets
      GET
    • Upload Pet Image
      POST
  • Chat
    • Create Chat Completion
      POST
  • Payments
    • Pay Order
      POST
  • Store
    • List Inventory
      GET
    • Create Order
      POST
    • Get Order
      GET
    • Delete Order
      DELETE
    • Callback Example
      POST
  • User
    • Create User
      POST
    • Update User
      PUT
    • Get User
      GET
    • Delete User
      DELETE
    • Login
      POST
    • Logout
      POST
  • Webhooks
    • Pet Adopted Event
    • New Pet Available Event
  • Schemas
    • Pet
    • PetCollection
    • User
    • OrderPayment
    • Bank Card
    • Bank Account
    • Category
    • Links
    • Order
    • ApiResponse
    • Tag
    • Error
Modern Petstore APIClassic Petstore APIBlog
Modern Petstore APIClassic Petstore APIBlog
  1. Pet

Create Pet

POST
/pets
Add a new pet to the store catalog, making it available for adoption.

Pet Lifecycle Workflow#

When a new pet enters the system:
1.
Intake: Staff creates a pet record with this endpoint (status: available)
2.
Profile: Pet details include species, breed, age, medical info, photos, and adoption fee
3.
Discovery: Pet appears in search results and listings
4.
Adoption Application: Potential adopters can apply through the adoption endpoints
5.
Adoption: Once approved, pet status changes to adopted
6.
Post-Adoption: Pet record is retained for historical purposes
Access: This operation requires staff permissions (write:pets scope or valid Bearer token). Only authenticated staff members can add pets to the system.

Request

Authorization
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
or
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢201
application/json
Pet created successfully
Headers

Body

🟠400BadRequest
🟠401Unauthorized
🟠422UnprocessableEntity
🟠429TooManyRequests
Request Request Example
Shell
JavaScript
Java
Swift
curl -X POST 'https://api.petstoreapi.com/v1/pets' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "species": "dog",
    "name": "Buddy",
    "breed": "Golden Retriever",
    "age_months": 24,
    "size": "large",
    "color": "Golden",
    "gender": "male",
    "good_with_kids": true,
    "good_with_pets": true,
    "adoption_fee": 150.00,
    "description": "Friendly golden retriever looking for an active family"
  }'
Response Response Example
201 - Example 1
{
    "id": "pet_c4t_5x7k9m",
    "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-17 08:25:04
Previous
Delete Pet
Next
List Pets
Built with