Auto generate captions through the CMA

Hi Dato team,

Apologies if I missed this, is there a way to generate auto captions through the CMA?

I did clock that there is the upload track API available but that appears to be adding already created captions either through a URL or asset ID.

If this doesn’t exist, would it be possible to add this API to the CMA?

Thank you!

Hi @danny

It is an internal/experimental API that should be considered unstable, but you can run it if you’d like: Automatically generate a subtitles track — Upload track — Content Management API — DatoCMS

By “unstable”, I mean that it is not a formal API endpoint that we can guarantee stability for, so it may change or break at any time. If this is a script that you manually run on occasion, it should be fine, but I wouldn’t build any mission-critical automations on top of it.

There are a few unlisted endpoints like this in the CMS. They are considered unlisted and unstable on purpose, being experimental and/or internal-use endpoints, and again, they are subject to unannounced changes or breakages at any time.

That said, you can see many of them in our TypeScript definitions (with a deprecated warning, though really they’re more just unstable rather than truly deprecated), e.g. client.uploadTracks.generateSubtitles(). Or if you ever want to see how the CMS software does something, the browser network inspector should let you capture the details, e.g.:

In this case, you can either use the deprecated/experimental client method or send a HTTP POST to https://site-api.datocms.com/uploads/${uploadId}/tracks/generate-subtitles with a body like:

{
  "data": {
    "type": "upload_track",
    "attributes": {
      "language_code": "en",
      "name": "English (generated)"
    }
  }
}

I’ll also leave this feature request open (please remember to vote on it). Seems like a good one that we should elevate to a “real” endpoint someday!

1 Like

Totally missed this while I was in there! Thanks so much for the info @roger!

1 Like

No, you didn’t, actually :slight_smile: Those experimental endpoints don’t normally show up in the docs menus, so it’s not something you’d discover organically. It’s a safety measure so people don’t accidentally use one of these without knowing what they’re getting themselves into.

When you see a warning like this (which was actually added just a few days ago):

It means that you’re come across an unlisted, unstable API, probably by clicking through to it from our TypeScript defs.

They’re not exactly secret or private per se… they’re just primarily for internal use, unpolished, unstable, and may change or break without warning. Some of them have auto-generated docs, some of them have a comment or two added by a human staff member, and others have no documentation at all.

1 Like