Method: channelBanners.insert

Uploads a channel banner image to YouTube and sets it as the channel's banner.

This method requires a media upload: send the image bytes as the media payload to the /upload URI rather than in a JSON request body (any JSON metadata payload is ignored). Uploaded images must meet the following requirements:

  • Aspect ratio: 16:9
  • Dimensions: At least 2048x1152 pixels (recommended: 2560x1440 pixels)
  • Maximum file size: 6 MiB
  • Accepted media MIME types: image/jpeg, image/png, application/octet-stream (decoded image must be JPEG or PNG)

For method-specific error responses, see channelBanners.insert errors.

HTTP request

POST https://youtube.googleapis.com/upload/youtube/v3/channelBanners/insert

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
channelId

string

Identifies the YouTube channel that receives the uploaded banner image.

Use this parameter when the authenticated user acts as an authorized delegate for another channel. The caller must have write permission on the specified channel, or the API returns an HTTP 403 accountDelegationForbidden error. When omitted, the API targets the channel specified by onBehalfOfContentOwnerChannel (if set) or the authenticated user's channel.

onBehalfOfContentOwner

string

This parameter is intended exclusively for YouTube content partners.

The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.

To upload a banner for a channel managed by the content owner, also specify the onBehalfOfContentOwnerChannel parameter.

onBehalfOfContentOwnerChannel

string

This parameter can only be used in a properly authorized request, and is intended exclusively for YouTube content partners.

The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel for which the banner image is being uploaded. Specify this parameter together with onBehalfOfContentOwner to target a channel managed by the content owner. If channelId is also set, the request targets that channel instead; if neither is set, the request targets the authenticated user's own channel. This parameter can only be used with onBehalfOfContentOwner, the authenticating CMS account must be linked to that content owner, and the specified channel must be linked to that content owner.

This parameter allows content owners to authenticate once and perform actions on behalf of the specified channel without providing authentication credentials for each separate channel.

Request body

The request body must be empty.

Response body

If successful, the response body contains an instance of ChannelBannerResource.

Authorization scopes

Requires one of the following OAuth scopes:

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

For more information, see the OAuth 2.0 Overview.