---
title: "Update Transcript Speakers"
method: PUT
path: "/media/speakers/{mediaId}"
tags: ["Media (Audio/Video)"]
---

# Update Transcript Speakers

`PUT /media/speakers/{mediaId}`

## Request

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

### Request Description

This API endpoint allows you to update speaker names in the transcription of a media object.

#### Endpoint

`PUT /v1/media/speakers/:mediaId`

#### Method

`PUT`

#### Purpose

The purpose of this request is to update the speaker information associated with a specific media object. This includes modifying the names of the speakers in the transcription data.

#### Input Parameters

- `mediaId` (path parameter): The unique identifier for the media object whose speaker information you wish to update.

- **Request Body**: The request body should be a JSON array containing objects with the following structure:

 - **id** (string): The unique identifier for the speaker **(ORIGINAL)**.

 - **name** (string): The new name of the speaker.


#### Response Structure

The response will return a JSON object containing the following fields:

- **status**: Indicates the status of the request.

- **message**: String


#### Example Response

``` json
{
 "status": "",
 "message": ""
}

 ```

#### Notes

- Ensure that the `mediaId` provided in the URL corresponds to an existing media object.

- The request body must be formatted as a JSON array, even if updating a single speaker.

- The response will confirm the status of the update operation, along with any relevant data about the media analysis.

**Request rules.** The body is an array, one entry per speaker you are relabelling, and every entry needs `id` and `name`. Omit `segmentIds` to relabel every segment for that speaker, or pass them to limit the rename to one paragraph. Pass `mergeIntoId` to merge this speaker into an existing one.

## Path parameters

- `mediaId` string, required

## Request body

- object[]: One entry per speaker you want to relabel.
  - `id` string, required: The speaker you are renaming, given as either the speaker's current label or its numeric speaker id. Required on every array entry. Trimmed. The server matches the current label first and the numeric id second (resolveTargetSpeaker at, so a label wins when both could match.
  - `name` string, required: The new name for that speaker. Required on every array entry. Trimmed. Reusing another speaker's name returns 400 unless you also send mergeIntoId on the same entry.
  - `segmentIds` number[]: The transcript segment ids you want renamed. Send it to limit the change to one paragraph, and leave it out to rename every segment belonging to that speaker. Optional. Items must be numbers. No minimum or maximum item count.
  - `mergeIntoId` string: The id of the speaker you are merging this one into. Sending it confirms you meant to combine two speakers, so the duplicate name check is skipped for this entry. Optional. An empty string is allowed, and an empty string counts as not set.

## Response `200`

OK

- object
  - `status` string
  - `data` object
    - `insight` object
      - `isAnalyze` boolean
      - `transcript` object[]
        - `id` integer
        - `text` string
        - `confidence` number
        - `speakerId` integer
        - `language` string
        - `instances` object[]
          - `adjustedStart` string
          - `adjustedEnd` string
          - `start` string
          - `end` string
      - `faces` unknown[]
        - unknown
      - `keywords` object[]
        - `isDeleted` boolean
        - `instances` object[]
          - `adjustedStart` string
          - `adjustedEnd` string
          - `start` string
          - `end` string
        - `id` integer
        - `name` string
      - `labels` unknown[]
        - unknown
      - `brands` unknown[]
        - unknown
      - `topics` object[]
        - `isDeleted` boolean
        - `instances` object[]
          - `adjustedStart` string
          - `adjustedEnd` string
          - `start` string
          - `end` string
        - `id` integer
        - `name` string
      - `people` unknown[]
        - unknown
      - `locations` unknown[]
        - unknown
      - `arts` unknown[]
        - unknown
      - `dates` unknown[]
        - unknown
      - `events` unknown[]
        - unknown
      - `geopolitical` unknown[]
        - unknown
      - `languages` unknown[]
        - unknown
      - `laws` unknown[]
        - unknown
      - `money` unknown[]
        - unknown
      - `ordinals` unknown[]
        - unknown
      - `percentages` unknown[]
        - unknown
      - `quantities` unknown[]
        - unknown
      - `times` unknown[]
        - unknown
      - `cardinals` unknown[]
        - unknown
      - `nationalities` unknown[]
        - unknown
      - `products` unknown[]
        - unknown
    - `duration` object
      - `inSecond` string
      - `end` string
      - `start` string
    - `summary` object
      - `original` object
        - `text` string
        - `createdAt` string, date-time
    - `tags` unknown[]
      - unknown
    - `isTranscriptionOnly` boolean
    - `processingProgress` string
    - `state` string
    - `remark` string
    - `sentiment` object[]
      - `document` object
        - `Negative` integer
        - `Neutral` integer
        - `Positive` integer
      - `sentences` object[]
        - `id` integer
        - `instances` unknown[]
          - unknown
        - `score` object
          - `compound` integer
          - `neg` integer
          - `neu` integer
          - `pos` integer
        - `text` string
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `name` string
    - `description` string
    - `publishedUrl` string
    - `mediaId` string
    - `originalCreatedAt` string, date-time
    - `faceSpriteImg` string

---

[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)
