Split a segment in two
curl --request POST \
--url https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"at_seconds": 1.4,
"source": {
"first_text": "Welcome",
"second_text": "to our Q3 webinar."
},
"translation": {
"first_text": "Bienvenidos",
"second_text": "a nuestro webinar del tercer trimestre."
}
}
'import requests
url = "https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split"
payload = {
"at_seconds": 1.4,
"source": {
"first_text": "Welcome",
"second_text": "to our Q3 webinar."
},
"translation": {
"first_text": "Bienvenidos",
"second_text": "a nuestro webinar del tercer trimestre."
}
}
headers = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'If-Match': '<if-match>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
at_seconds: 1.4,
source: {first_text: 'Welcome', second_text: 'to our Q3 webinar.'},
translation: {
first_text: 'Bienvenidos',
second_text: 'a nuestro webinar del tercer trimestre.'
}
})
};
fetch('https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'at_seconds' => 1.4,
'source' => [
'first_text' => 'Welcome',
'second_text' => 'to our Q3 webinar.'
],
'translation' => [
'first_text' => 'Bienvenidos',
'second_text' => 'a nuestro webinar del tercer trimestre.'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"If-Match: <if-match>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split"
payload := strings.NewReader("{\n \"at_seconds\": 1.4,\n \"source\": {\n \"first_text\": \"Welcome\",\n \"second_text\": \"to our Q3 webinar.\"\n },\n \"translation\": {\n \"first_text\": \"Bienvenidos\",\n \"second_text\": \"a nuestro webinar del tercer trimestre.\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("If-Match", "<if-match>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"at_seconds\": 1.4,\n \"source\": {\n \"first_text\": \"Welcome\",\n \"second_text\": \"to our Q3 webinar.\"\n },\n \"translation\": {\n \"first_text\": \"Bienvenidos\",\n \"second_text\": \"a nuestro webinar del tercer trimestre.\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["If-Match"] = '<if-match>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"at_seconds\": 1.4,\n \"source\": {\n \"first_text\": \"Welcome\",\n \"second_text\": \"to our Q3 webinar.\"\n },\n \"translation\": {\n \"first_text\": \"Bienvenidos\",\n \"second_text\": \"a nuestro webinar del tercer trimestre.\"\n }\n}"
response = http.request(request)
puts response.read_body{
"object": "transcript_edit_result",
"segments": [
{
"object": "segment",
"id": "5f0e2c7a-1b3d-4e6f-8a9c-2d4e6f8a0b11",
"project_id": "6f1c2b7e-8a4d-4e3f-9b5c-1d0a7e2f3c58",
"start_seconds": 0,
"end_seconds": 1.4,
"speaker_id": "SPEAKER_00",
"speaker_label": "Speaker 1",
"source": {
"text": "Welcome",
"language": "en"
},
"translation": {
"text": "Bienvenidos",
"language": "es-es"
},
"words": null,
"needs_attention": false,
"status": "ready",
"dub_state": "outdated",
"audio": null,
"selected_variant_id": null,
"translation_variants": null,
"processing_started_at": null,
"etag": "\"s-0152404eba194814\""
},
{
"object": "segment",
"id": "7d4f1b8e-5c2a-4e9d-b3f6-1a8c4e7b2d44",
"project_id": "6f1c2b7e-8a4d-4e3f-9b5c-1d0a7e2f3c58",
"start_seconds": 1.4,
"end_seconds": 3.2,
"speaker_id": "SPEAKER_00",
"speaker_label": "Speaker 1",
"source": {
"text": "to our Q3 webinar.",
"language": "en"
},
"translation": {
"text": "a nuestro webinar del tercer trimestre.",
"language": "es-es"
},
"words": null,
"needs_attention": false,
"status": "ready",
"dub_state": "outdated",
"audio": null,
"selected_variant_id": null,
"translation_variants": null,
"processing_started_at": null,
"etag": "\"s-7be62984f0f8c54c\""
}
],
"deleted_segment_ids": [],
"operations": [
{
"index": 0,
"segment_ids": [
"5f0e2c7a-1b3d-4e6f-8a9c-2d4e6f8a0b11",
"7d4f1b8e-5c2a-4e9d-b3f6-1a8c4e7b2d44"
]
}
],
"effects": {
"needs_redub_segment_ids": [
"5f0e2c7a-1b3d-4e6f-8a9c-2d4e6f8a0b11",
"7d4f1b8e-5c2a-4e9d-b3f6-1a8c4e7b2d44"
],
"audio_dropped_segment_ids": [
"5f0e2c7a-1b3d-4e6f-8a9c-2d4e6f8a0b11"
],
"retranslation": null,
"speakers_pending_voice": [],
"instant_clone_settings_reset": [],
"restore_point_version": 8,
"project_needs_redub": true
},
"warnings": []
}Segments
Split a segment in two
Splits a segment at at_seconds.
POST
/
projects
/
{project_id}
/
segments
/
{segment_id}
/
split
Split a segment in two
curl --request POST \
--url https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"at_seconds": 1.4,
"source": {
"first_text": "Welcome",
"second_text": "to our Q3 webinar."
},
"translation": {
"first_text": "Bienvenidos",
"second_text": "a nuestro webinar del tercer trimestre."
}
}
'import requests
url = "https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split"
payload = {
"at_seconds": 1.4,
"source": {
"first_text": "Welcome",
"second_text": "to our Q3 webinar."
},
"translation": {
"first_text": "Bienvenidos",
"second_text": "a nuestro webinar del tercer trimestre."
}
}
headers = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'If-Match': '<if-match>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
at_seconds: 1.4,
source: {first_text: 'Welcome', second_text: 'to our Q3 webinar.'},
translation: {
first_text: 'Bienvenidos',
second_text: 'a nuestro webinar del tercer trimestre.'
}
})
};
fetch('https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'at_seconds' => 1.4,
'source' => [
'first_text' => 'Welcome',
'second_text' => 'to our Q3 webinar.'
],
'translation' => [
'first_text' => 'Bienvenidos',
'second_text' => 'a nuestro webinar del tercer trimestre.'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"If-Match: <if-match>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split"
payload := strings.NewReader("{\n \"at_seconds\": 1.4,\n \"source\": {\n \"first_text\": \"Welcome\",\n \"second_text\": \"to our Q3 webinar.\"\n },\n \"translation\": {\n \"first_text\": \"Bienvenidos\",\n \"second_text\": \"a nuestro webinar del tercer trimestre.\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("If-Match", "<if-match>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"at_seconds\": 1.4,\n \"source\": {\n \"first_text\": \"Welcome\",\n \"second_text\": \"to our Q3 webinar.\"\n },\n \"translation\": {\n \"first_text\": \"Bienvenidos\",\n \"second_text\": \"a nuestro webinar del tercer trimestre.\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}/split")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["If-Match"] = '<if-match>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"at_seconds\": 1.4,\n \"source\": {\n \"first_text\": \"Welcome\",\n \"second_text\": \"to our Q3 webinar.\"\n },\n \"translation\": {\n \"first_text\": \"Bienvenidos\",\n \"second_text\": \"a nuestro webinar del tercer trimestre.\"\n }\n}"
response = http.request(request)
puts response.read_body{
"object": "transcript_edit_result",
"segments": [
{
"object": "segment",
"id": "5f0e2c7a-1b3d-4e6f-8a9c-2d4e6f8a0b11",
"project_id": "6f1c2b7e-8a4d-4e3f-9b5c-1d0a7e2f3c58",
"start_seconds": 0,
"end_seconds": 1.4,
"speaker_id": "SPEAKER_00",
"speaker_label": "Speaker 1",
"source": {
"text": "Welcome",
"language": "en"
},
"translation": {
"text": "Bienvenidos",
"language": "es-es"
},
"words": null,
"needs_attention": false,
"status": "ready",
"dub_state": "outdated",
"audio": null,
"selected_variant_id": null,
"translation_variants": null,
"processing_started_at": null,
"etag": "\"s-0152404eba194814\""
},
{
"object": "segment",
"id": "7d4f1b8e-5c2a-4e9d-b3f6-1a8c4e7b2d44",
"project_id": "6f1c2b7e-8a4d-4e3f-9b5c-1d0a7e2f3c58",
"start_seconds": 1.4,
"end_seconds": 3.2,
"speaker_id": "SPEAKER_00",
"speaker_label": "Speaker 1",
"source": {
"text": "to our Q3 webinar.",
"language": "en"
},
"translation": {
"text": "a nuestro webinar del tercer trimestre.",
"language": "es-es"
},
"words": null,
"needs_attention": false,
"status": "ready",
"dub_state": "outdated",
"audio": null,
"selected_variant_id": null,
"translation_variants": null,
"processing_started_at": null,
"etag": "\"s-7be62984f0f8c54c\""
}
],
"deleted_segment_ids": [],
"operations": [
{
"index": 0,
"segment_ids": [
"5f0e2c7a-1b3d-4e6f-8a9c-2d4e6f8a0b11",
"7d4f1b8e-5c2a-4e9d-b3f6-1a8c4e7b2d44"
]
}
],
"effects": {
"needs_redub_segment_ids": [
"5f0e2c7a-1b3d-4e6f-8a9c-2d4e6f8a0b11",
"7d4f1b8e-5c2a-4e9d-b3f6-1a8c4e7b2d44"
],
"audio_dropped_segment_ids": [
"5f0e2c7a-1b3d-4e6f-8a9c-2d4e6f8a0b11"
],
"retranslation": null,
"speakers_pending_voice": [],
"instant_clone_settings_reset": [],
"restore_point_version": 8,
"project_needs_redub": true
},
"warnings": []
}Without explicit texts the source splits at the word boundary nearest the time and missing translations are retranslated in one job. The first half keeps the id; both halves become
outdated; variants are cleared and audio dropped.
When to use: to separate two sentences or speakers.
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: If-Match with the current segment ETag is required (428 if missing or *, 412 with current_etag if stale). On 412 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_busy (409), project_not_ready (409), dub_in_progress (409), transcript_busy (409), too_many_concurrent_jobs (429), dub_payment_required (409)Authorizations
Headers
Path Parameters
Body
application/json
Body of splitSegment. Omitted texts: the source splits at the word boundary nearest at_seconds and missing translations are retranslated.
Response
OK: TranscriptEditResult.
Result of a segment or transcript mutation. Transient (no id).