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

Update audio / subtitle track

PATCH
https://api.fastpix.com/v1/on-demand/:mediaId/tracks/:trackId
PATCH
/v1/on-demand/:mediaId/tracks/:trackId
$curl -X PATCH https://api.fastpix.com/v1/on-demand/4fa85f64-5717-4562-b3fc-2c963f66afa6/tracks/4fa85f64-5717-4562-b3fc-2c963f66afa6 \
> -H "Content-Type: application/json" \
> -u "<username>:<password>" \
> -d '{
> "url": "http://commondatastorage.googleapis.com/codeskulptor-assets/sounddogs/thrust.vtt",
> "languageCode": "fr",
> "languageName": "french"
>}'
200Updated
1{
2 "success": true,
3 "data": {
4 "id": "2452ca23-b7ed-4daf-babf-841996b0100e",
5 "type": "subtitle",
6 "url": "http://commondatastorage.googleapis.com/codeskulptor-assets/sounddogs/thrust.vtt",
7 "languageCode": "fr",
8 "languageName": "french"
9 }
10}
This endpoint allows you to update an existing audio or subtitle track associated with a media file. When updating a track, you must provide the new track `url`, `languageName`, and `languageCode`, ensuring all three parameters are included in the request. #### How it works 1. Send a PATCH request to this endpoint, replacing `{mediaId}` with the media ID, and `{trackId}` with the ID of the track you want to update. 2. Provide the necessary details in the request body. 3. Receive a response confirming the track update. #### Webhook Events After updating a track, your system must receive webhook notifications: 1. After successfully updating a track, your system must receive the webhook event <a href="https://docs.fastpix.io/docs/transform-media-events#videomediatrackupdated">video.media.track.updated</a>. 2. Once the new 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. Once the media file is updated with the new track details, a <a href="https://docs.fastpix.io/docs/media-events#videomediaupdated">video.media.updated</a> event must be triggered. #### Example Suppose you previously added a French subtitle track to a video but now need to update it with a different file. By calling this API, you can replace the existing subtitle file (.vtt) with a new one while keeping the same track ID. This is useful when: - The original track file has errors and needs correction. - You want to improve subtitle translations or replace an audio track with a better-quality version. 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

Generate track subtitle

Next
Built with

This endpoint allows you to update an existing audio or subtitle track associated with a media file. When updating a track, you must provide the new track url, languageName, and languageCode, ensuring all three parameters are included in the request.

How it works

  1. Send a PATCH request to this endpoint, replacing {mediaId} with the media ID, and {trackId} with the ID of the track you want to update.

  2. Provide the necessary details in the request body.

  3. Receive a response confirming the track update.

Webhook Events

After updating a track, your system must receive webhook notifications:

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

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

  3. Once the media file is updated with the new track details, a video.media.updated event must be triggered.

Example

Suppose you previously added a French subtitle track to a video but now need to update it with a different file. By calling this API, you can replace the existing subtitle file (.vtt) with a new one while keeping the same track ID. This is useful when:

  • The original track file has errors and needs correction.
  • You want to improve subtitle translations or replace an audio track with a better-quality version.

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

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

Request

This endpoint expects an object.
urlstringRequiredformat: "uri"Defaults to http://commondatastorage.googleapis.com/codeskulptor-assets/sounddogs/thrust.vtt
The direct URL of the track file. It must point to a valid audio or subtitle file.
languageCodestringRequiredDefaults to fr

The BCP 47 language code representing the track’s language.

languageNamestringRequiredDefaults to French

The full name of the language corresponding to the languageCode.

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.