---
title: "Replace an audio clip's recording"
method: PUT
path: "/test_framework/v1/scenarios-external/{id}/condition-audio/{audio_id}/"
tags: ["test_framework"]
---

# Replace an audio clip's recording

`PUT /test_framework/v1/scenarios-external/{id}/condition-audio/{audio_id}/`

## Request

- Base URL: `https://api.cekura.ai`
- URL: `https://api.cekura.ai/test_framework/v1/scenarios-external/{id}/condition-audio/{audio_id}/`
- Auth: one of:
  - API key in header `X-CEKURA-API-KEY`
  - HTTP bearer
  - HTTP bearer

Replace this clip's audio. Every action referencing it plays the new recording. Pass `name` to rename the clip at the same time — its `<audio>` tags are repointed for you, and the response carries `previous_audio_id` and the rewritten `actions`. The clip is transcoded and re-transcribed, so runs are blocked again until that finishes. Send the file as `multipart/form-data`, or as `application/json` with `file_name` and base64 `content_base64`.

## Path parameters

- `id` integer, required
- `audio_id` string, required

## Request body

- object
  - `file_name` string, required: Filename including its extension: wav, mp3, m4a, ogg, webm or flac.
  - `content_base64` string, byte, required: Base64-encoded audio, max 25 MB decoded. Accepts a raw base64 string or a `data:<mime>;base64,...` data URI.
  - `name` string

## Response `202`

- ConditionAudioEntry: Read serializer for one Scenario.condition_audio entry (a plain dict). The caller passes each entry dict with `audio_id` injected; fields are tolerant of missing keys. `previous_action` is intentionally not exposed (internal undo state for a clip that replaced a whole action).
  - `audio_id` string, nullable
  - `action` string, nullable
  - `condition_id` string: First condition referencing this clip, or null when no action references it. Kept for compatibility - prefer condition_ids.
  - `condition_ids` integer[]: Every condition referencing this clip, in authored order. Empty when the clip is uploaded but not referenced by any action yet.
  - `steps` string: Every step referencing this clip, as paths into the conditional actions (e.g. `first_message`, `conditions[1].then[0]`).
  - `tag` string: The reference to paste into an action, e.g. <audio id="greeting"/>
  - `status` string, nullable
  - `transcript` string, nullable
  - `words` ConditionAudioWord[]: The transcript's words with the time each is spoken in the clip. Absent until the clip has been transcribed.
    - `word` string, required
    - `start` number, double, required: Seconds from the start of the clip.
    - `end` number, double, required: Seconds from the start of the clip.
  - `duration` number, double, nullable
  - `filename` string, nullable
  - `timing_source` string, nullable: Where the word timings came from: `deepgram` (measured), `interpolated` (spread evenly), or `manual` (sent with a transcript edit).
  - `error` string, nullable
  - `updated_at` string, nullable
  - `playback_url` string: S3 URL of the recorded audio clip

## Other responses

- `400`
- `404`
- `409`

## Changes

- **2026-11-03** `a6fb6a739212`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cekura/apis/cekura-api/changes/test_framework/v1/scenarios-external/:id/condition-audio/:audio_id/put.md)

---

[API](https://skmtc.dev/cekura/apis/cekura-api.md) - [All operations](https://skmtc.dev/cekura/apis/cekura-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cekura/apis/cekura-api/revisions/a6fb6a739212?raw)
