Swagger Petstore - OpenAPI 3.0
POST/pet/{petId}/uploadImage

Upload a pet image

Uploads an image for a specific pet. Use petId to select the pet, send the image as binary request content, and optionally provide additionalMetadata. The response contains processing details for the uploaded file.

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

2 parameters
petIdintegerrequired
The numeric identifier of the pet whose image you want to upload.
additionalMetadatastringoptional
Additional metadata to associate with the uploaded image.

4 status codes
200Returns an upload result containing a numeric `code`, result `type`, and explanatory `message`.
codeintegeroptional
typestringoptional
messagestringoptional
400Returned when no file is uploaded.
404Returned when no pet exists with the supplied `petId`.
defaultReturned when an unexpected error occurs.

Error handling

A 400 is returned when no file is uploaded. A 404 is returned when no pet exists with the supplied petId; send binary content and use petId to identify the target pet.