Pets
Upload a pet image
Attach a binary image body to an existing pet.
Uploads an application/octet-stream body for a pet and returns an ApiResponse object.
The native request panel shows the URL, credential, path, and query values, but it cannot represent this operation's binary body. Use the complete cURL example after the endpoint block when sending an upload.
Upload an image for a pet.
POST
/pet/{petId}/uploadImageOAuth 2.0 bearer token with `write:pets` and `read:pets` scopes.
ID of the pet to update.
Optional metadata to associate with the upload.
Response
{200}Successful operation
{400}No file uploaded
{404}Pet not found
cURL
curl --request POST \ --url https://petstore3.swagger.io/api/v3/pet/10/uploadImage?additionalMetadata=profile%20photo \ --header 'Authorization: Bearer example_access_token'
{
"code": 200,
"type": "success",
"message": "image uploaded"
}bash
curl --request POST \
--header 'Authorization: Bearer example_access_token' \
--header 'Content-Type: application/octet-stream' \
--data-binary '@pet-photo.jpg' \
'https://petstore3.swagger.io/api/v3/pet/10/uploadImage?additionalMetadata=profile%20photo'Replace pet-photo.jpg with a local image path. The request sends the file bytes directly; it does not wrap them in JSON.
The request body is optional in the OpenAPI structure, but the operation defines 400 when no file is uploaded. The contract also defines a default Unexpected error response without a fixed status or body schema.