# Upload Channel Banner — YouTube Data

> Uploads a channel banner image to YouTube. See the documentation for more information

- Key: `youtube_data_api-upload-channel-banner`
- Type: Action (Write)
- Version: 1.0.2
- 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/upload-channel-banner
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/youtube_data_api/actions/upload-channel-banner/upload-channel-banner.mjs

## Description

Uploads a channel banner image to YouTube. [See the documentation](https://developers.google.com/youtube/v3/docs/channelBanners/insert) for more information

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `filePath` | `string` | Yes | Provide either a file URL or a path to a file in the /tmp directory (for example, /tmp/myFile.pdf). |
| `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. |
| `syncDir` | `dir` | No | SyncDir |

## 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-upload-channel-banner",
  arguments: {
    filePath: "File Path or URL",
    onBehalfOfContentOwner: "On Behalf Of Content Owner",
  },
})
```

**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-upload-channel-banner",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    youtube_data_api: { authProvisionId: "apn_xxxxxxx" },
    filePath: "File Path or URL",
    onBehalfOfContentOwner: "On Behalf Of Content Owner",
  },
})

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-upload-channel-banner",
    "configured_props": {
      "youtube_data_api": { "authProvisionId": "apn_xxxxxxx" },
      "filePath": "File Path or URL",
      "onBehalfOfContentOwner": "On Behalf Of Content Owner"
    }
  }'
```

---

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