POST/pet/{petId}/uploadImage

Upload an image for a pet

Uploads an image for a pet. Specify the pet with petId and send the image as the request body; you can include optional additionalMetadata as a query parameter. The response contains the upload result details.

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

2 parameters
petIdintegerrequired
The int64 identifier of the pet to update with an image.
additionalMetadatastringoptional
Optional metadata to include with the image upload.

4 status codes
200Returns an upload result object with `code`, `type`, and `message` fields.
codeintegeroptional
typestringoptional
messagestringoptional
400Returned when no file is uploaded.
404Returned when the pet cannot be found.
defaultUnexpected error

Error handling

A 400 is returned when no file is uploaded, and a 404 is returned when the pet cannot be found. The petId path parameter identifies the pet to receive the image.