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 | ||
part |
string 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:
|
|
Optional parameters | ||
onBehalfOfContentOwner |
string 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 type | Error detail | Description |
---|---|---|
badRequest (400) |
notEditable |
This channel section cannot be edited. |
badRequest (400) |
typeRequired |
The channelSection resource must specify a value for the snippet.type field. |
forbidden (403) |
channelSectionForbidden |
The request is not properly authenticated or is not supported for this channel. |
invalidValue (400) |
channelNotActive |
At least one of the specified channels is not active. |
invalidValue (400) |
channelsDuplicated |
The request failed because it specified duplicate channels. |
invalidValue (400) |
channelsNeeded |
If 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) |
channelsNotExpected |
The 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) |
contentDetailsNeeded |
The resource you are updating must contain a contentDetails object for this type of channel section. |
invalidValue (400) |
idInvalid |
The id property specifies an invalid channel section ID. |
invalidValue (400) |
idRequired |
The id property must specify a value that identifies the channel section being updated. |
invalidValue (400) |
inValidPosition |
The snippet.position property contains an invalid value. |
invalidValue (400) |
maxChannelsExceeded |
The request failed because it attempted to include too many channels in the channel section. |
invalidValue (400) |
maxPlaylistExceeded |
The request failed because it attempted to include too many playlists in the channel section. |
invalidValue (400) |
onePlaylistNeeded |
If the snippet.type property has a value of singlePlaylist , then the contentDetails.playlists[] property must specify exactly one playlist. |
invalidValue (400) |
ownChannelInChannels |
You cannot include your own channel in a channel section that appears on that channel. |
invalidValue (400) |
playlistIsPrivate |
One or more of the specified playlists are private and, therefore, cannot be included in the channel section. |
invalidValue (400) |
playlistsDuplicated |
The request failed because it specified duplicate playlists. |
invalidValue (400) |
playlistsNeeded |
If the snippet.type property has a value of singlePlaylist or multiplePlaylists , then the contentDetails.playlists[] property must be specified. |
invalidValue (400) |
playlistsNotExpected |
The 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) |
snippetNeeded |
You must specify a snippet to update the channel section. |
invalidValue (400) |
titleLengthExceeded |
The value of the snippet.title property is too long. |
invalidValue (400) |
titleRequired |
If 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) |
channelNotFound |
One or more of the specified channels cannot be found. |
notFound (404) |
channelSectionNotFound |
The channel section you are trying to update cannot be found. |
notFound (404) |
playlistNotFound |
One 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.