POST/pet/{petId}/uploadImage

Upload a pet image

Uploads an image for a specific pet. Supply the pet's petId and send the image as an octet-stream request body; use additionalMetadata to include optional metadata. The response provides a result object with a code, message, and type.

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

2 parameters
petIdintegerrequired

The int64 identifier of the pet to upload an image for.

additionalMetadatastringoptional

Optional metadata to include with the image upload.

4 status codes
200Returns an upload result object containing a code, message, and type.
codeintegeroptional
messagestringoptional
typestringoptional
400Returned when no file is uploaded.
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 identifies the pet, and the request body must contain the image as binary data.