Skip to main content
POST
Merge adjacent segments
Merges 2-20 adjacent segments into the earliest one (server-ordered by start): texts joined with a space, times spanning all, variants cleared, audio dropped, the others deleted; retranslates by default. When to use: to join fragments of one sentence. Side effects: Commits atomically: the project’s pipeline_status becomes transcript_edited, segment ETags change, affected segments become outdated (listed in the response’s effects) and their audio may be dropped. Cost: Free. An edit that starts a translation counts against the payer’s translation budget (429 rate_limited, policy translation-hour) and its 5 concurrent translation jobs (429 too_many_concurrent_jobs); then nothing is written. Idempotency: Idempotency-Key accepted (SDKs send one); retries within 24 h replay the first response. Concurrency: each entry of segments carries that segment’s ETag (no If-Match header); all are checked in one atomic write, and a stale one fails with 412 precondition_failed naming it (errors[].pointer /segments/<i>/etag, current_etag): re-read, re-apply once and retry. Refused during processing (409 project_not_ready) and while a dub runs, from its start until its merge ends or it fails (409 dub_in_progress); 409 transcript_busy means concurrent writes kept conflicting: retry after Retry-After. Paid text: on a project created through v3, 409 dub_payment_required until a dub of that project is charged. Required scopes: transcripts:write Errors: transcript_not_ready (409), segment_not_found (404), segment_busy (409), project_not_ready (409), dub_in_progress (409), transcript_busy (409), too_many_concurrent_jobs (429), dub_payment_required (409)

Authorizations

Authorization
string
header
required

API key from Settings -> API keys, sent as Authorization: Bearer <key> (SDK environment variable RASK_API_KEY). Bound to one workspace and one acting user. Operations list the scopes they need (OpenAPI 3.1 scopes on a bearer scheme).

Scopes

transcripts:write

Headers

Idempotency-Key
string

Optional. A unique key per logical request (SDKs send a bare UUIDv4; an RFC 9651 quoted string is accepted and unquoted); reuse it unchanged on retries to replay the first response.

Required string length: 1 - 255
Pattern: ^[\x20-\x7E]+$

Path Parameters

project_id
string
required

Project id (from createProject or listProjects).

Maximum string length: 64

Body

application/json

Body of mergeSegments.

segments
object[]
required

2-20 adjacent segments, each with the ETag read last (no If-Match header). All ETags are checked in one atomic write: a stale one fails with 412 precondition_failed (errors[].pointer /segments//etag, current_etag of that segment); a repeated id fails with 422 validation_failed (segment_targeted_twice). The server orders them by start and the earliest id survives.

Required array length: 2 - 20 elements
speaker_id
string

Speaker of the merged segment; default: the earliest segment's.

Maximum string length: 11
Pattern: ^SPEAKER_\d{2,3}$
retranslate
boolean
default:true

Retranslate the merged text.

Response

OK: TranscriptEditResult.

Result of a segment or transcript mutation. Transient (no id).

object
enum<string>
required

Always transcript_edit_result.

Available options:
transcript_edit_result
segments
object[]
required

Every created or changed segment, read back consistently, in time order.

deleted_segment_ids
string[]
required

Deleted segments.

operations
object[]
required

Segments per operation.

effects
object
required

Effects of a committed write.

warnings
object[]
required

Warnings.