title: Delete videos from playlist using YouTube API
body: <p>I'm trying to delete a video from one of my playlists using the YouTube API. I'm properly authenticated but I'm still getting the following error:</p>
  
  <pre><code>{
      "code" : 403,
      "errors" : [ {
      "domain" : "youtube.playlistItem",
      "location" : "id",
      "locationType" : "parameter",
      "message" : "Forbidden",
      "reason" : "playlistItemsNotAccessible"
      } ],
  "message" : "Forbidden"
  }
  </code></pre>
  
  <p>I'm following the instructions here: <a href="https://developers.google.com/youtube/v3/docs/playlistItems/delete" rel="nofollow noreferrer">https://developers.google.com/youtube/v3/docs/playlistItems/delete</a></p>
  
  <p>But what I don't understand is where you're supposed to put the playlistID. I see where you put the videoID, but how does it know which playlist to delete from? I think that's my problem. Here is the code in their example, and mine is identical:</p>
  
  <pre><code>// Sample java code for playlistItems.delete
  
  public static void main(String[] args) throws IOException {
      YouTube service = getYouTubeService();
      try {
          HashMap&lt;String, String&gt; parameters = new HashMap&lt;&gt;();
          parameters.put("id", "REPLACE_ME");
          parameters.put("onBehalfOfContentOwner", "");
  
          YouTube.PlaylistItems.Delete playlistItemsDeleteRequest = youtube.playlistItems().delete(parameters.get("id").toString());
          if (parameters.containsKey("onBehalfOfContentOwner") &amp;&amp; parameters.get("onBehalfOfContentOwner") != "") {
              playlistItemsDeleteRequest.setOnBehalfOfContentOwner(parameters.get("onBehalfOfContentOwner").toString());
          }
  
          playlistItemsDeleteRequest.execute();
      }
  }
  </code></pre>
  
  <p>There's not even an input for the playlistID in their "try it" section on the page, which also gives the same error. Just onBehalfOfContentOwner and id. I get the same error after putting in a videoID and executing it on the page. Where should I put the playlistID? </p>