---
title: "Edit one table-read line."
method: PATCH
path: "/scripts/{scriptUploadId}/lines/{entryIndex}"
tags: ["Scripts"]
---

# Edit one table-read line.

`PATCH /scripts/{scriptUploadId}/lines/{entryIndex}`

## Request

- Base URL: `https://docs.sleeperhit.studio/api/v1`
- URL: `https://docs.sleeperhit.studio/api/v1/scripts/{scriptUploadId}/lines/{entryIndex}`
- Auth: HTTP bearer

Partial update. Only the named fields change; the line's current values are saved to its history first (`versions`); the rest are left alone. There is deliberately no speed and no acting-direction field — a re-voice of the line (`revoice_line`, POST /artifacts/{artifactId}/revoice-line) sets each, so a volume change keeps the line's existing speed and no edit touches its direction (and there is no emotion field: a line is performed from its acting direction); `actingDirection` here is refused with 400 `validation_failed`, naming that re-voice. An unknown field, a wrong-typed value or an index past the end is refused with 400 `validation_failed` — the same validation the Writers Lab's line editor, MCP `edit_script_line` and `sleeperhit script line set` go through. Answers the line as it now stands. Free and naturally idempotent, so no `Idempotency-Key`: it renders nothing, and the next recording of that line uses it.

## Request body

- ScriptLineEdit: Only the line fields to change; keys left out are untouched. There is deliberately no speed and no acting-direction field — re-voice the line (POST /artifacts/{artifactId}/revoice-line) to change either; `actingDirection` here is refused with 400 `validation_failed`. There is no emotion field: a line is performed from its acting direction.
  - `text` string
  - `ttsText` string
  - `parenthetical` string
  - `sceneHeading` string
  - `volume` number: The line's level (1: its own).
  - `pauseAfterMs` integer: Milliseconds to pause after the line before the next. The one pause field.

## Response `200`

The line after the change.

- ScriptLineTuning
  - `scriptUploadId` string, required
  - `entryIndex` integer, required
  - `audits` object[], required: The Slug conversation's rolling audit of this line, newest last.
  - `versions` object[], required: The edit snapshots taken before each change, newest first.
  - `line` object, nullable, required: The line's current editable state, or null when the index is past the end.
    - `text` string, required
    - `ttsText` string, nullable, required
    - `parenthetical` string, nullable, required
    - `sceneHeading` string, nullable, required
    - `speed` number, required: How fast the line is spoken (1: its natural pace) — set only by re-voicing the line (`revoice_line`).
    - `volume` number, required: The line's level (1: its own).
    - `pauseAfterMs` integer, nullable, required
    - `actingDirection` string, nullable, required: How the line is performed, in words: the one authority for its delivery (there are no emotion tags). Changed only by re-voicing the line.
    - `sentAs` object, nullable, required: What the line's acting direction was sent to its voice as: on a Cartesia voice (sonic-3 and newer) the mapping step's one emotion from the voice's list and the speed it was sent at. Null when nothing was mapped for the direction the line has now.
      - `emotion` string, required: One emotion from the voice's fixed list.
      - `speed` number, required: The speed it was sent at: the line's own when set, else the direction's pace nudge, else 1.
      - `label` string, required: The one sentence every surface shows: "Sent as: sad, 0.9x".

## 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 named project or source does not exist or is owned by another account.
- `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/4534f5d25540?raw)
