ChannelSections: update

Updates a channel section.

Quota impact: A call to this method has a quota cost of 50 units.

Common use cases

Request

HTTP request

PUT https://www.googleapis.com/youtube/v3/channelSections

Authorization

This request requires authorization with at least one of the following scopes (read more about authentication and authorization).

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

Parameters

The following table lists the parameters that this query supports. All of the parameters listed are query parameters.

Parameters
Required parameters
partstring
The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.

The following list contains the part names that you can include in the parameter value:
  • contentDetails
  • id
  • snippet
Optional parameters
onBehalfOfContentOwnerstring
This parameter can only be used in a properly authorized request. Note: 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.

Request body

Provide a channelSection resource in the request body. For that resource:

  • You must specify a value for these properties:

    • snippet.type

  • You can set values for these properties:

    • snippet.type
    • snippet.title
    • snippet.position
    • contentDetails.playlists[]
    • contentDetails.channels[]

    If you are submitting an update request, and your request does not specify a value for a property that already has a value, the property's existing value will be deleted.

Response

If successful, this method returns a channelSection resource in the response body.

Errors

The following table identifies error messages that the API could return in response to a call to this method. Please see the error message documentation for more detail.

Error typeError detailDescription
badRequest (400)notEditableThis channel section cannot be edited.
badRequest (400)typeRequiredThe channelSection resource must specify a value for the snippet.type field.
forbidden (403)channelSectionForbiddenThe request is not properly authenticated or is not supported for this channel.
invalidValue (400)channelNotActiveAt least one of the specified channels is not active.
invalidValue (400)channelsDuplicatedThe request failed because it specified duplicate channels.
invalidValue (400)channelsNeededIf the snippet.type property has a value of multipleChannels, then the contentDetails.channels[] property must be specified and must specify at least one channel.
invalidValue (400)channelsNotExpectedThe resource provided with the request specified a value for the contentDetails.channels[] property, but channels are not expected for this type of channel section.
invalidValue (400)contentDetailsNeededThe resource you are updating must contain a contentDetails object for this type of channel section.
invalidValue (400)idInvalidThe id property specifies an invalid channel section ID.
invalidValue (400)idRequiredThe id property must specify a value that identifies the channel section being updated.
invalidValue (400)inValidPositionThe snippet.position property contains an invalid value.
invalidValue (400)maxChannelsExceededThe request failed because it attempted to include too many channels in the channel section.
invalidValue (400)maxPlaylistExceededThe request failed because it attempted to include too many playlists in the channel section.
invalidValue (400)onePlaylistNeededIf the snippet.type property has a value of singlePlaylist, then the contentDetails.playlists[] property must specify exactly one playlist.
invalidValue (400)ownChannelInChannelsYou cannot include your own channel in a channel section that appears on that channel.
invalidValue (400)playlistIsPrivateOne or more of the specified playlists are private and, therefore, cannot be included in the channel section.
invalidValue (400)playlistsDuplicatedThe request failed because it specified duplicate playlists.
invalidValue (400)playlistsNeededIf the snippet.type property has a value of singlePlaylist or multiplePlaylists, then the contentDetails.playlists[] property must be specified.
invalidValue (400)playlistsNotExpectedThe resource provided with the request specified a value for the contentDetails.playlists[] property, but playlists are not expected for this type of channel section.
invalidValue (400)snippetNeededYou must specify a snippet to update the channel section.
invalidValue (400)titleLengthExceededThe value of the snippet.title property is too long.
invalidValue (400)titleRequiredIf the snippet.type property has a value of multiplePlaylists or multipleChannels, then you must set the section's title by specifying a value for the snippet.title property.
notFound (404)channelNotFoundOne or more of the specified channels cannot be found.
notFound (404)channelSectionNotFoundThe channel section you are trying to update cannot be found.
notFound (404)playlistNotFoundOne or more of the specified playlists cannot be found.

Try it!

Use the APIs Explorer to call this API and see the API request and response.