Show examples in:
JavascriptHTTP
Endpoint info
Available examples
Content Management API > Upload track

Automatically generate a subtitles track

Warning: Experimental API

Please note that this API method is marked as unstable and should be avoided in production environments. Changes may occur at any time without warning, potentially impacting your scripts. We recommend contacting our Support Team to explore alternative approaches that are safer and more reliable!

Body parameters

language_codestringRequired

A valid BCP 47 specification compliant language code

Example:"it-IT"
namestringOptional

The human-readable name of the track

Example:"Italiano"

Returns

Returns a resource object of type upload_track

Examples

import { buildClient } from "@datocms/cma-client-node";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const uploadId = "xBe7u01029ipxBLQhYzZCJ1cke01zCkuUsgnYtH0017nNzbpv2YcsoMDmw";
const uploadTrack = await client.uploadTracks.generateSubtitles(uploadId, {
language_code: "it-IT",
});
// Check the 'Returned output' tab for the result ☝️
console.log(uploadTrack);
}
run();
{
id: "xBe7u01029ipxBLQhYzZCJ1cke01zCkuUsgnYtH0017nNzbpv2YcsoMDmw",
type: "subtitles",
name: "Italiano",
language_code: "it-IT",
closed_captions: false,
status: "ready",
error: null,
upload: { type: "upload", id: "q0VNpiNQSkG6z0lif_O1zg" },
}