Edit a transcript segment
curl --request PATCH \
--url https://api.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, and welcome to the show.",
"transcriptSpeakerId": "cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0"
}
'import requests
url = "https://api.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}"
payload = {
"text": "Hello, and welcome to the show.",
"transcriptSpeakerId": "cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Hello, and welcome to the show.',
transcriptSpeakerId: 'cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0'
})
};
fetch('https://api.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}', 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.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'text' => 'Hello, and welcome to the show.',
'transcriptSpeakerId' => 'cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}"
payload := strings.NewReader("{\n \"text\": \"Hello, and welcome to the show.\",\n \"transcriptSpeakerId\": \"cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.patch("https://api.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, and welcome to the show.\",\n \"transcriptSpeakerId\": \"cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Hello, and welcome to the show.\",\n \"transcriptSpeakerId\": \"cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Transcript updated successfully",
"messageKey": "TranscriptUpdatedSuccessfully"
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}Transcript Editing
Edit Transcript Segment
Replaces a segment’s text and speaker: send both every time. Its times don’t change. Words you keep, and words you correct one for one (a typo or punctuation), keep their timing; added words and the words of a rewritten phrase have none. The updated segment isn’t returned.
PATCH
/
v2
/
transcript-jobs
/
{jobId}
/
transcripts
/
{transcriptId}
Edit a transcript segment
curl --request PATCH \
--url https://api.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, and welcome to the show.",
"transcriptSpeakerId": "cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0"
}
'import requests
url = "https://api.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}"
payload = {
"text": "Hello, and welcome to the show.",
"transcriptSpeakerId": "cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Hello, and welcome to the show.',
transcriptSpeakerId: 'cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0'
})
};
fetch('https://api.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}', 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.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'text' => 'Hello, and welcome to the show.',
'transcriptSpeakerId' => 'cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}"
payload := strings.NewReader("{\n \"text\": \"Hello, and welcome to the show.\",\n \"transcriptSpeakerId\": \"cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.patch("https://api.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, and welcome to the show.\",\n \"transcriptSpeakerId\": \"cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v2/transcript-jobs/{jobId}/transcripts/{transcriptId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Hello, and welcome to the show.\",\n \"transcriptSpeakerId\": \"cc3c21c5-e8bc-436a-a9a9-b0385c2b81b0\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Transcript updated successfully",
"messageKey": "TranscriptUpdatedSuccessfully"
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}Authorizations
Path Parameters
Query Parameters
Body
application/json
Was this page helpful?