# Delete Playlist Items — YouTube Data

> Deletes a playlist item. See the documentation for more information

- Key: `youtube_data_api-delete-playlist-items`
- Type: Action (Write)
- Version: 0.0.3
- App: YouTube Data (`youtube_data_api`) — https://pipedream.com/apps/youtube-data-api.md
- This page (HTML): https://pipedream.com/apps/youtube-data-api/actions/delete-playlist-items
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/youtube_data_api/actions/delete-playlist-items/delete-playlist-items.mjs

## Description

Deletes a playlist item. [See the documentation](https://developers.google.com/youtube/v3/docs/playlistItems/delete) for more information

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `playlistId` | `string` | Yes | Add items to the selected playlist. E.g. PLJswo-CV0rmlwxKysf33cUnyBp8JztH0k Options are loaded from the connected account. |
| `videoIds` | `string[]` | Yes | Array of identifiers of the videos to be removed from the playlist. E.g. o_U1CQn68VM Options are loaded from the connected account. |
| `onBehalfOfContentOwner` | `string` | No | 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. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "youtube_data_api",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "youtube_data_api-delete-playlist-items",
  arguments: {
    playlistId: "Playlist ID",
    videoIds: ["Video IDs"],
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "youtube_data_api-delete-playlist-items",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    youtube_data_api: { authProvisionId: "apn_xxxxxxx" },
    playlistId: "Playlist ID",
    videoIds: ["Video IDs"],
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "youtube_data_api-delete-playlist-items",
    "configured_props": {
      "youtube_data_api": { "authProvisionId": "apn_xxxxxxx" },
      "playlistId": "Playlist ID",
      "videoIds": ["Video IDs"]
    }
  }'
```

---

- App: https://pipedream.com/apps/youtube-data-api.md · All apps: https://pipedream.com/apps
