# Update Video Details — YouTube Data

> Updates a video's metadata. See the documentation for more information

- Key: `youtube_data_api-update-video-details`
- 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/update-video-details
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/youtube_data_api/actions/update-video-details/update-video-details.mjs

## Description

Updates a video's metadata. [See the documentation](https://developers.google.com/youtube/v3/docs/videos/update) for more information

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `videoId` | `string` | Yes | Select the video to update. E.g. wslno0wDSFQ Options are loaded from the connected account. |
| `title` | `string` | No | The video's title |
| `description` | `string` | No | The video's description |
| `tags` | `string[]` | No | A list of keyword tags associated with the video. Tags may contain spaces. |
| `regionCode` | `string` | No | The regionCode parameter instructs the API to return results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. For example: US, GB, BR |
| `categoryId` | `string` | No | Select the video's category 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-update-video-details",
  arguments: {
    videoId: "Video ID",
    title: "Title",
  },
})
```

**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-update-video-details",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    youtube_data_api: { authProvisionId: "apn_xxxxxxx" },
    videoId: "Video ID",
    title: "Title",
  },
})

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-update-video-details",
    "configured_props": {
      "youtube_data_api": { "authProvisionId": "apn_xxxxxxx" },
      "videoId": "Video ID",
      "title": "Title"
    }
  }'
```

---

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