YouTube

PlaylistItems: update

Modifies a playlist item. For example, you could update the item's position in the playlist. Try it now.

Request

HTTP request

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

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

Parameters

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

Parameter name Value Description
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 part names that you can include in the parameter value are snippet, contentDetails, and status.

Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings.

Request body

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

  • You must specify a value for these properties:

    • id
    • snippet.playlistId
    • snippet.resourceId

  • You can set values for these properties:

    • snippet.position
    • contentDetails.note
    • contentDetails.startAt
    • contentDetails.endAt

    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 playlistItem resource in the response body.

Errors

The table below 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
invalidValue (400) invalidPlaylistItemPosition The request attempts to set the playlist item's position to an invalid or unsupported value. Check the value of the position property in the resource's snippet.
invalidValue (400) invalidResourceType The type specified for the resource ID is not supported for this operation. The resource ID identifies the item being added to the playlist – e.g. youtube#video.
invalidValue (400) invalidSnippet The request does not specify a valid snippet property.
notFound (404) playlistItemNotFound The playlist item identified with the request's id property cannot be found.
notFound (404) playlistNotFound The playlist identified with the request's playlistId parameter cannot be found.
required (400) channelIdRequired The request does not specify a value for the required channelId property.
required (400) playlistIdRequired The request does not specify a value for the required playlistId property.
required (400) playlistItemIdRequired The playlist item resource specified in the request must use the id property to identify the playlist item that is being updated.

Try it!

Use the API Explorer to call this method on live data and see the API request and response.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.