# Uploads an image.

Upload image of the pet.

[Uploads an image.](https://clay-doc.github.io/clay-example-repo/api/petstore/pet/upload-file.md)

```sh
curl -X POST 'https://petstore3.swagger.io/api/v3/pet/0/uploadImage' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/octet-stream' \
  --data-binary @file
```
## Authentication

::: fields
- `petstore_auth` *write:pets* *read:pets*

  [OAuth 2.0](https://clay-doc.github.io/clay-example-repo/api/petstore.md#authentication)
:::

## Parameters

::: fields
- `petId` integer (int64) **required** *path*

  ID of pet to update
- `additionalMetadata` string *query*

  Additional Metadata
:::

## Request body

:badge[application/octet-stream]{note} · Type: any

## Responses

::: tabs status
== 200

successful operation

:badge[application/json]{note} · Type: [ApiResponse](https://clay-doc.github.io/clay-example-repo/api/petstore/schemas/api-response.md)

::: fields
- `code` integer (int32)
- `type` string
- `message` string
:::

```json [Example]
{
  "code": 0,
  "type": "string",
  "message": "string"
}
```

== 400

No file uploaded

== 404

Pet not found

== default

Unexpected error
:::

---

All pages of these docs, as Markdown for language models: https://clay-doc.github.io/clay-example-repo/llms.txt
