For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
StatusSupportDiscussionsLog inSign Up
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
  • ACTIVATE ACCOUNT
    • Create account
  • PRODUCT OS API
    • Overview
  • ERROR CODES
    • Error codes
  • VIDEO ON DEMAND API
    • Overview
      • GETGet list of all media
      • GETGet all clips of a live stream
      • GETGet a media by ID
      • DELDelete a media by ID
      • PATCHUpdate a media by ID
      • POSTAdd audio / subtitle track
      • PUTCancel ongoing upload
      • DELDelete audio / subtitle track
      • PATCHUpdate audio / subtitle track
      • POSTGenerate track subtitle
      • GETGet the summary of a video
      • PATCHUpdate the source access of a media by ID
      • PATCHUpdate the mp4Support of a media by ID
      • GETGet info of media inputs
      • GETGet all unused upload URLs
      • GETGet all clips of a media
  • LIVE STREAM API
    • Overview
  • VIDEO DATA API
    • Overview
LogoLogo
StatusSupportDiscussionsLog inSign Up
VIDEO ON DEMAND APIManage videos

Add audio / subtitle track

POST
https://api.fastpix.com/v1/on-demand/:mediaId/tracks
POST
/v1/on-demand/:mediaId/tracks
$curl -X POST https://api.fastpix.com/v1/on-demand/4fa85f64-5717-4562-b3fc-2c963f66afa6/tracks \
> -H "Content-Type: application/json" \
> -u "<username>:<password>" \
> -d '{
> "tracks": {
> "url": "https://static.fastpix.com/music-1.mp3",
> "type": "audio",
> "languageCode": "it",
> "languageName": "Italian"
> }
>}'
201Created
1{
2 "success": true,
3 "data": {
4 "id": "ace60fc7-e876-4fc6-b9d9-c33fa242f84b",
5 "type": "audio",
6 "url": "https://static.fastpix.com/music-1.mp3",
7 "languageCode": "it",
8 "languageName": "Italian"
9 }
10}
This endpoint allows you to add an audio or subtitle track to an existing media file using its `mediaId`. You need to provide the track `url` along with its `type` (audio or subtitle), `languageName` and `languageCode` in the request payload. #### How it works 1. Send a POST request to this endpoint, replacing `{mediaId}` with the media ID (`uploadId` or `id`). 2. Provide the necessary details in the request body. 3. Receive a response containing a unique track ID and the details of the newly added track. #### Webhook events 1. After successfully adding a track, your system must receive the webhook event <a href="https://docs.fastpix.io/docs/transform-media-events#videomediatrackcreated">video.media.track.created</a>. 2. Once the track is processed and ready, you must receive the webhook event <a href="https://docs.fastpix.io/docs/transform-media-events#videomediatrackready">video.media.track.ready</a>. 3. Finally, an update event <a href="https://docs.fastpix.io/docs/media-events#videomediaupdated">video.media.updated</a> must notify your system about the media's updated status. #### Example Suppose you have a video uploaded to the FastPix platform, and you want to add an Italian audio track to it. By calling this API, you can attach an external audio file (https://static.fastpix.com/music-1.mp3) to the media file. Similarly, if you need to add subtitles in different languages, you can specify type: `subtitle` with the corresponding subtitle `url`, `languageCode` and `languageName`. Related guides: <a href="https://docs.fastpix.io/docs/manage-subtitle-tracks">Add own subtitle tracks</a>, <a href="https://docs.fastpix.io/docs/manage-audio-tracks">Add own audio tracks</a>
Was this page helpful?
Previous

Cancel ongoing upload

Next
Built with

This endpoint allows you to add an audio or subtitle track to an existing media file using its mediaId. You need to provide the track url along with its type (audio or subtitle), languageName and languageCode in the request payload.

How it works

  1. Send a POST request to this endpoint, replacing {mediaId} with the media ID (uploadId or id).

  2. Provide the necessary details in the request body.

  3. Receive a response containing a unique track ID and the details of the newly added track.

Webhook events

  1. After successfully adding a track, your system must receive the webhook event video.media.track.created.

  2. Once the track is processed and ready, you must receive the webhook event video.media.track.ready.

  3. Finally, an update event video.media.updated must notify your system about the media’s updated status.

Example

Suppose you have a video uploaded to the FastPix platform, and you want to add an Italian audio track to it. By calling this API, you can attach an external audio file (https://static.fastpix.com/music-1.mp3) to the media file. Similarly, if you need to add subtitles in different languages, you can specify type: subtitle with the corresponding subtitle url, languageCode and languageName.

Related guides: Add own subtitle tracks, Add own audio tracks

Authentication

AuthorizationBasic

FastPix APIs are secured with Basic Authentication. Use your Access Token ID as the username and Secret Key as the password in the Authorization header of each API request.

  • Username: Access Token ID
  • Password: Secret Key

Activate your FastPix account to generate your API credentials. See the guide here

Path parameters

mediaIdstringRequiredformat: "uuid"
The unique identifier assigned to the media when created. The value must be a valid UUID.

Request

This endpoint expects an object.
tracksobjectRequired
Contains details about the track being added to the media file.

Response

Media details updated successfully
successboolean
Demonstrates whether the request is successful or not.
dataobject
Contains details about the track that was added or updated.