---
title: "Edit a soundscape bed or region."
method: POST
path: "/artifacts/{artifactId}/soundscapes"
tags: ["Artifacts"]
---

# Edit a soundscape bed or region.

`POST /artifacts/{artifactId}/soundscapes`

## Request

- Base URL: `https://docs.sleeperhit.studio/api/v1`
- URL: `https://docs.sleeperhit.studio/api/v1/artifacts/{artifactId}/soundscapes`
- Auth: HTTP bearer

One edit by `op`: `update_bed` tunes a scene's bed (label, start/end offsets in lines, level, fades, loop or stretch); `add_region` adds a custom region over a range of lines (optionally with library audio, `assetId`); `update_region` moves or re-levels one; `attach` gives a bed or region library audio (`assetId`, from GET /library/audio); `remove` takes a bed's sound off or deletes a region. A region may not overlap another soundscape. Free; a finalized MP3/MP4 is marked stale. Requires `Idempotency-Key`. Scope: `artifact:publish`.

## Headers

- `Idempotency-Key` string, required

## Request body

- TableReadSoundscapeRequest: One soundscape edit by `op`. `update_bed` needs `sceneIndex`; `add_region` needs `startEntry` and `endEntry`; `update_region` needs `regionId`; `attach` needs `target` (`scene_bed` with `sceneIndex`, or `region` with `regionId`) and `assetId`; `remove` needs `target` and its `sceneIndex` or `regionId`.
  - `op` 'update_bed' | 'add_region' | 'update_region' | 'attach' | 'remove', required
  - `target` 'scene_bed' | 'region'
  - `sceneIndex` integer
  - `regionId` string
  - `assetId` string: A library audio asset (GET /library/audio).
  - `startEntry` integer
  - `endEntry` integer
  - `startEntryOffset` integer: A scene bed: lines after the scene's first line it starts.
  - `endEntryOffset` integer: A scene bed: lines before the scene's last line it ends.
  - `label` string
  - `volume` number
  - `fadeInMs` integer
  - `fadeOutMs` integer
  - `playMode` 'loop' | 'stretch'

## Response `200`

The edit and the bed or region as it now stands.

- TableReadSoundscapeResponse
  - `artifactId` string, required
  - `op` 'update_bed' | 'add_region' | 'update_region' | 'attach' | 'remove', required
  - `target` 'scene_bed' | 'region', required
  - `id` string, required
  - `soundscape` TableReadSoundscape, required: One soundscape: a scene's own bed, or a custom region across lines.
    - `kind` 'scene_bed' | 'region', required
    - `id` string, required: The scene index for a bed, the region id for a region.
    - `sceneIndex` integer, nullable, required
    - `label` string, required
    - `startEntry` integer, required
    - `endEntry` integer, required
    - `soundUrl` string, nullable, required
    - `libraryAssetId` string, nullable, required
    - `volume` number, nullable, required
    - `fadeInMs` number, nullable, required
    - `fadeOutMs` number, nullable, required
    - `playMode` 'loop' | 'stretch', nullable, required
    - `isDraft` boolean, required: A region not yet given a sound.

## Other responses

- `400`: Request payload failed validation. The error message names the offending field.
- `401`: Missing, malformed, revoked, or expired API key.
- `403`: API key is valid but lacks the scope, is blocked by IP allowlist, or the account is disabled.
- `404`: The story artifact does not exist or is owned by another account.
- `409`: The artifact is not in a state where this operation is valid yet (e.g. requesting an MP4 render before the share link exists).
- `429`: Rate limit for this API key + IP + route family was exceeded.
- `500`: The API failed unexpectedly. Safe to retry with the same Idempotency-Key.

---

[API](https://skmtc.dev/sleeperhit/apis/sleeper-hit-studio-story-api.md) · [All operations](https://skmtc.dev/sleeperhit/apis/sleeper-hit-studio-story-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sleeperhit/apis/sleeper-hit-studio-story-api/revisions/64c1102ccb2f?raw)
