# Create Asset — Mux

> Create a new asset with a track. See the documentation

- Key: `mux-create-asset`
- Type: Action (Write)
- Version: 0.0.3
- App: Mux (`mux`) — https://pipedream.com/apps/mux.md
- This page (HTML): https://pipedream.com/apps/mux/actions/create-asset
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/mux/actions/create-asset/create-asset.mjs

## Description

Create a new asset with a track. [See the documentation](https://docs.mux.com/api-reference#video/operation/create-asset)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `url` | `string` | Yes | The URL of the file that Mux should download and use. |
| `type` | `string` | No | The type of track |
| `languageCode` | `string` | No | The language code value must be a valid BCP 47 specification compliant value. For example, en for English or en-US for the US version of English. This parameter is required for text type and subtitles text type track. |
| `name` | `string` | No | The name of the track containing a human-readable description. This value must be unique across all text type and subtitles text type tracks. The hls manifest will associate a subtitle text track with this value. For example, the value should be "English" for subtitles text track with language_code as en. This optional parameter should be used only for text type and subtitles text type tracks. If this parameter is not included, Mux will auto-populate based on the input[].language_code value. |
| `closedCaptions` | `boolean` | No | Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This optional parameter should be used for text type and subtitles text type tracks. |
| `playbackPolicy` | `string` | No | Playback policy assigned to the asset |
| `mp4Support` | `string` | No | Level of support for mp4 playback |
| `normalizeAudio` | `boolean` | No | Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets. |
| `masterAccess` | `string` | No | Level of support for master access |

## 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": "mux",
      },
    },
  },
)

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: "mux-create-asset",
  arguments: {
    url: "URL",
    type: "Type",
  },
})
```

**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: "mux-create-asset",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    mux: { authProvisionId: "apn_xxxxxxx" },
    url: "URL",
    type: "Type",
  },
})

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": "mux-create-asset",
    "configured_props": {
      "mux": { "authProvisionId": "apn_xxxxxxx" },
      "url": "URL",
      "type": "Type"
    }
  }'
```

---

- App: https://pipedream.com/apps/mux.md · All apps: https://pipedream.com/apps
