---
title: "List labels on a transcript"
method: GET
path: "/media/{mediaId}/labels"
tags: ["Labels"]
---

# List labels on a transcript

`GET /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`

Returns every labelled passage on the media, ordered by position in the transcript, with the media's current `transcriptRevision`. Anyone who can open the file can read its labels; no labels permission is needed. 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.

When a transcript is saved, labels and comments on passages are moved to the new text in the background, after the save has answered. Until that finishes, which is normally a moment, a list can return anchors whose `anchor.transcriptRevision` is lower than the top-level `transcriptRevision`. Fetch the list again shortly after a save.

## Path parameters

- `mediaId` string, required

## Query parameters

- `status` 'active' | 'shifted' | 'needs_review'

## Response `200`

Success

- object
  - `status` 'success': `success` on every 2xx response.
  - `data` object: The result.
    - `transcriptRevision` integer: The media's current transcript revision. Send it as `expectedTranscriptRevision` when you label or comment.
    - `mediaLabels` object[]: Labelled passages, ordered by `anchor.startWord`.
      - `mediaLabelId` string: Id of the labelled passage.
      - `mediaId` string: Id of the media.
      - `labelIds` string[]: Labels on the passage.
      - `anchor` object: Where the passage sits in the transcript. Built by the server from the word range you send.
        - `startWord` integer: Position of the first word.
        - `endWord` integer: Position of the last word, inclusive.
        - `exact` string: The quoted words, joined by single spaces.
        - `prefix` string: Up to 32 characters of transcript text before the quote.
        - `suffix` string: Up to 32 characters of transcript text after the quote.
        - `startInSec` number: Start time of the first word, in seconds.
        - `endInSec` number: End time of the last word, in seconds.
        - `speakerIds` string[]: Speakers of the quoted words.
        - `transcriptRevision` integer: The transcript revision these positions refer to.
      - `status` 'active' | 'shifted' | 'needs_review': `active`: the same words, possibly at new positions after an edit. `shifted`: most of the words survived an edit near the same time, but the text changed. `needs_review`: the words changed too much to follow; `anchor` then holds a suggested passage on the new transcript and `lastResolved` the last position a person confirmed.
      - `lastResolved` object: Present only while `status` is `needs_review`: the last position a person confirmed.
        - `startWord` integer: Position of the first word.
        - `endWord` integer: Position of the last word, inclusive.
        - `exact` string: The quoted words, joined by single spaces.
        - `prefix` string: Up to 32 characters of transcript text before the quote.
        - `suffix` string: Up to 32 characters of transcript text after the quote.
        - `startInSec` number: Start time of the first word, in seconds.
        - `endInSec` number: End time of the last word, in seconds.
        - `speakerIds` string[]: Speakers of the quoted words.
        - `transcriptRevision` integer: The transcript revision these positions refer to.
      - `userId` string: Id of the person who first labelled the passage.
      - `createdAt` string, date-time: When it was created.
      - `updatedAt` string, date-time: When it last changed.

## Other responses

- `400`: A path or query value failed validation
- `404`: The media does not exist or you cannot open it

---

[API](https://skmtc.dev/speakai/apis/speak-ai-api.md) · [All operations](https://skmtc.dev/speakai/apis/speak-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/speakai/apis/speak-ai-api/revisions/52d777e6d46e?raw)
