# Method: posts.imageUpload

- [HTTP request](https://developers.google.com/youtube/data/reference/rest/v3/posts/imageUpload.md.txt#body.HTTP_TEMPLATE)
- [Query parameters](https://developers.google.com/youtube/data/reference/rest/v3/posts/imageUpload.md.txt#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/youtube/data/reference/rest/v3/posts/imageUpload.md.txt#body.request_body)
- [Response body](https://developers.google.com/youtube/data/reference/rest/v3/posts/imageUpload.md.txt#body.response_body)
  - [JSON representation](https://developers.google.com/youtube/data/reference/rest/v3/posts/imageUpload.md.txt#body.PostImageUploadResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/youtube/data/reference/rest/v3/posts/imageUpload.md.txt#body.aspect)
- [Try it!](https://developers.google.com/youtube/data/reference/rest/v3/posts/imageUpload.md.txt#try-it)

Uploads an image for a post and returns an upload token. To attach the image to a post, set the token as an `attachments.imageAttachments[].uploadToken` value when you call the [`posts.insert`](https://developers.google.com/youtube/data/reference/rest/v3/posts/insert.md.txt) method.

This method is in a pilot phase with access limited to select launch partners (approved Google Cloud projects). Broader public API access is planned for General Availability in 2027.

This method accepts raw binary image data in the HTTP request body rather than a JSON `Post` resource; the empty **Request body** section applies only to JSON metadata, not the binary media upload. Uploaded files must meet the following requirements:

- **Maximum file size:** 16 MiB
- **Accepted media MIME types:** `image/jpeg`, `image/png`, `image/gif`, `image/webp`, `application/octet-stream`
- **Image formats:** JPEG, PNG, GIF, or WebP (detected from the file contents)
- **Aspect ratio:** Between 2:5 and 5:2 (width to height), inclusive

The authorized user must own the channel or have permission to create posts for it.

**Quota impact:** A call to this method has a [quota cost](https://developers.google.com/youtube/data/getting-started.md.txt#quota) of 1 unit. The cost counts against the **Post Modifications and Image Uploads** quota, which is separate from the default YouTube Data API quota.

For method-specific error responses, see [posts.imageUpload errors](https://developers.google.com/youtube/data/reference/rest/v3/errors.md.txt#posts_youtube.posts.imageUpload).

### HTTP request

`POST https://youtube.googleapis.com/upload/youtube/v3/posts/image`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Query parameters

| Parameters ||
|---|---|
| `channelId` | `string` Required. The ID of the channel that publishes the post that uses this image. The returned upload token works only in posts for this channel. |

### Request body

The request body must be empty.

### Response body

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "imageUploadToken": string } ``` |

| Fields ||
|---|---|
| `imageUploadToken` | `string` The token that identifies the uploaded image. Set this value as an `attachments.imageAttachments[].uploadToken` value when you call [`posts.insert`](https://developers.google.com/youtube/data/reference/rest/v3/posts/insert.md.txt) for the same channel. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/youtube`
- `https://www.googleapis.com/auth/youtubepartner`
- `https://www.googleapis.com/auth/youtube.force-ssl`
- `https://www.googleapis.com/auth/youtube.upload`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).