POST/pet/{petId}/uploadImage

Upload a pet image

Uploads an image for a pet in the store. Supply the petId path parameter and send the image as a binary request body; you can optionally include additionalMetadata. The response contains a code, type, and message describing the upload result.

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

2 parameters
petIdintegerrequired
The integer identifier of the pet to associate with the uploaded image.
additionalMetadatastringoptional
Optional metadata to include with the image upload.

4 status codes
200Returns an object containing a result code, type, and message.
codeintegeroptional
typestringoptional
messagestringoptional
400Returned when the request does not include a file.
404Returned when the pet is not found.
defaultUnexpected error

Error handling

A 400 is returned when no file is uploaded, and a 404 when the pet is not found. The petId path parameter must identify an existing pet to receive the image.