---
title: Add audio tracks to a video
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/python)

[Stream](https://developers.cloudflare.com/api/python/resources/stream)

[Audio Tracks](https://developers.cloudflare.com/api/python/resources/stream/subresources/audio_tracks)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Add audio tracks to a video

stream.audio\_tracks.copy(stridentifier, AudioTrackCopyParams\*\*kwargs) -> [Audio](<https://developers.cloudflare.com/api/python/resources/stream#(resource)%20stream.audio_tracks%20%3E%20(model)%20audio%20%3E%20(schema)>)

POST/accounts/{account\_id}/stream/{identifier}/audio/copy

Adds an additional audio track to a video using the provided audio track URL.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### ParametersExpand Collapse

account\_id: str

The account identifier tag.

maxLength32

[Link to this property](<#(resource)%20stream.audio_tracks%20%3E%20(method)%20copy%20%3E%20(params)%20default%20%3E%20(param)%20account_id%20%3E%20(schema)>)

identifier: str

A Cloudflare-generated unique identifier for a media item.

maxLength32

[Link to this property](<#(resource)%20stream.audio_tracks%20%3E%20(method)%20copy%20%3E%20(params)%20default%20%3E%20(param)%20identifier%20%3E%20(schema)>)

label: str

A string to uniquely identify the track amongst other audio track labels for the specified video.

[Link to this property](<#(resource)%20stream.audio_tracks%20%3E%20(method)%20copy%20%3E%20(params)%20default%20%3E%20(param)%20label%20%3E%20(schema)>)

url: Optional\[str]

An audio track URL. The server must be publicly routable and support `HTTP HEAD` requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` requests with a `content-range` header that includes the size of the file.

formaturi

[Link to this property](<#(resource)%20stream.audio_tracks%20%3E%20(method)%20copy%20%3E%20(params)%20default%20%3E%20(param)%20url%20%3E%20(schema)>)

##### ReturnsExpand Collapse

<details>

<summary>

class Audio: …

</summary>

default: Optional\[bool]

Denotes whether the audio track will be played by default in a player.

<a href="#(resource)%20stream.audio_tracks%20%3E%20(model)%20audio%20%3E%20(schema)%20%3E%20(property)%20default">Link to this property</a>

label: Optional\[str]

A string to uniquely identify the track amongst other audio track labels for the specified video.

<a href="#(resource)%20stream.audio_tracks%20%3E%20(model)%20audio%20%3E%20(schema)%20%3E%20(property)%20label">Link to this property</a>

<details>

<summary>

status: Optional\[Literal\["queued", "ready", "error"]]

Specifies the processing status of the video.

</summary>

One of the following:

"queued"

<a href="#(resource)%20stream.audio_tracks%20%3E%20(model)%20audio%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

"ready"

<a href="#(resource)%20stream.audio_tracks%20%3E%20(model)%20audio%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

"error"

<a href="#(resource)%20stream.audio_tracks%20%3E%20(model)%20audio%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20stream.audio_tracks%20%3E%20(model)%20audio%20%3E%20(schema)%20%3E%20(property)%20status">Link to this property</a>

uid: Optional\[str]

A Cloudflare-generated unique identifier for a media item.

maxLength32

<a href="#(resource)%20stream.audio_tracks%20%3E%20(model)%20audio%20%3E%20(schema)%20%3E%20(property)%20uid">Link to this property</a>

</details>

[Link to this property](<#(resource)%20stream.audio_tracks%20%3E%20(model)%20audio%20%3E%20(schema)>)

### Add audio tracks to a video

Python

HTTPTypeScriptPythonGoTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
audio = client.stream.audio_tracks.copy(
    identifier="ea95132c15732412d22c1476fa83f27a",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
    label="director commentary",
)
print(audio.uid)
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "default": true,
    "label": "director commentary",
    "status": "queued",
    "uid": "ea95132c15732412d22c1476fa83f27a"
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "default": true,
    "label": "director commentary",
    "status": "queued",
    "uid": "ea95132c15732412d22c1476fa83f27a"
  }
}
```