GET/pet/{petId}

Get a pet by ID

Retrieves a pet from the store by its identifier. Use petId to select the pet whose details you need.

1 parameter
petIdintegerrequired
The identifier of the pet to retrieve.

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 supplied pet ID is invalid.
404Returned when no pet is found with the supplied ID.
defaultReturned when an unexpected error occurs.

Error handling

A 400 is returned when the pet ID is invalid, and a 404 when the pet is not found. The petId path parameter must identify the pet to retrieve.