Labels

Label a passage

Requires the Labels: Assign permission (on by default for admins and members). The media must belong to your company and be one you can open. Owners and members with the folder Access all permission can open any file; everyone else can open files in folders assigned to them or their groups, and files they own. Any other media returns 404, the same as a media id that does not exist.

How to address words

Send the word range and the revision you read it from. Word positions count every word of the transcript in order, starting at 0. Within each sentence, words come from entities in order (an entity that holds several words, such as "New York", counts as several), or from the sentence text split on whitespace when the sentence has no entities. A token that is only punctuation is not counted. expectedTranscriptRevision is the transcriptRevision you read the transcript at, from GET /media/transcript/{mediaId}, GET /media/insight/{mediaId}, or the list endpoints on this page. The server builds the anchor from its own copy of the transcript. If the transcript has been saved since, the request returns 409 "This transcript changed since you opened it. Reload to keep editing." and nothing is written: read the transcript again and recompute the word range.

Request rules

  • When the same words already carry labels at this revision, the labels you send are added to that passage and the existing passage is returned.
  • A transcript holds at most 5,000 labelled passages; past that the request returns 400.

Errors

  • 400 when a field fails validation, the range runs past the transcript, a label is archived, a group or not in your company, or the passage limit is reached.
  • 403 without the permission.
  • 404 when the media does not exist or you cannot open it.
  • 409 when expectedTranscriptRevision is stale.
post/media/{mediaId}/labels

Request

  • Base URL: https://api.speakai.co/v1
  • URL: https://api.speakai.co/v1/media/{mediaId}/labels
  • Auth: API key in header x-speakai-key and API key in header x-access-token

Path parameters

mediaIdstring required

Id of the media file. Trimmed, then 1 to 64 characters from A-Z, a-z, 0-9, _ and - (pattern ^[A-Za-z0-9_-]{1,64}$). Anything else returns 400.

Request body

labelIdsstring[] required

Labels to put on the passage. 1 to 20 ids, no repeats. Each must be an active label (not a group) in your company, or the request returns 400 "Choose active labels from this workspace (groups cannot be applied)."

expectedTranscriptRevisioninteger required

The transcriptRevision you read the transcript at. Integer, 0 or more. A stale value returns 409.

Response

Success

status'success'

success on every 2xx response.

Changes

No recorded changes to this operation across all 2 revisions of this API.