POST/pet

Create a pet in the store

Creates a pet record in the store. Supply name and photoUrls; status, when supplied, must be available, pending, or sold. A 200 response returns the pet record.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

6 body fields

Pet details to add to the store. name and photoUrls are required.

idintegeroptional
The pet's unique identifier.
namestringrequired
The pet's name.
categoryobjectoptional
The pet's category, including its identifier and name.
photoUrlsarray<string>required
A list of URLs for photos of the pet.
tagsarray<object>optional
A list of tags, each with an identifier and name.
statusstringoptional
pet status in the store
Allowed:availablependingsold

4 status codes
200Returns the pet record, including its name, photo URLs, and any supplied category, tags, and status.
idintegeroptional
namestringrequired
categoryobjectoptional
photoUrlsarray<string>required
tagsarray<object>optional
statusstringoptional
pet status in the store
Allowed:availablependingsold
400Returned when the input is invalid.
422Returned when the request fails validation.
defaultUnexpected error

Error handling

Invalid input returns a 400, and a validation exception returns a 422. The name and photoUrls fields are required; status must be one of available, pending, or sold.