POST/pet

Create a pet

Creates a new pet in the store. Supply name and photoUrls; status, when provided, must be available, pending, or sold. The response includes the created pet and its available details.

  • 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, with an optional identifier and name.
photoUrlsarray<string>required
An array of URLs for photos of the pet.
tagsarray<object>optional
An array of tags, each with an optional identifier and name.
statusstringoptional
pet status in the store
Allowed:availablependingsold

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

Error handling

A 400 is returned for invalid input, including an invalid status; a 422 is returned for a validation exception. name and photoUrls are required, and status must be one of available, pending, or sold.