Create transcription task
curl --request POST \
--url https://heardraft.com/api/v1/transcriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Length: <content-length>' \
--header 'Content-Type: audio/wav' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '<string>'import requests
url = "https://heardraft.com/api/v1/transcriptions"
payload = "<string>"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Length": "<content-length>",
"Authorization": "Bearer <token>",
"Content-Type": "audio/wav"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'Content-Length': '<content-length>',
Authorization: 'Bearer <token>',
'Content-Type': 'audio/wav'
},
body: '<string>'
};
fetch('https://heardraft.com/api/v1/transcriptions', 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://heardraft.com/api/v1/transcriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Length: <content-length>",
"Content-Type: audio/wav",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://heardraft.com/api/v1/transcriptions"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Content-Length", "<content-length>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "audio/wav")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://heardraft.com/api/v1/transcriptions")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Length", "<content-length>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "audio/wav")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://heardraft.com/api/v1/transcriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Length"] = '<content-length>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'audio/wav'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"id": "8b1e23fa-4c2b-4a8e-9b19-1d63df06a012",
"sourceId": "1f9c2810-79a4-4f25-8f55-c2e60ad1a4be",
"status": "ready",
"expiresAt": null,
"result": {
"text": "Welcome back everyone.\nLet's review the interview timeline before Friday.",
"durationSeconds": 142.4,
"segments": [
{
"text": "Let's review the interview timeline before Friday.",
"startMs": 4200,
"endMs": 8650,
"speaker": "Speaker 1"
}
]
},
"error": {
"code": "TRANSCRIPTION_FAILED",
"message": "Transcription could not finish."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}Transcriptions
Create transcription task
Uploads a raw audio or video file as the request body and queues an asynchronous transcription task. Requires an active annual HearDraft plan, a valid workspace API key, a Content-Length header, a supported media Content-Type, and an Idempotency-Key.
POST
/
api
/
v1
/
transcriptions
Create transcription task
curl --request POST \
--url https://heardraft.com/api/v1/transcriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Length: <content-length>' \
--header 'Content-Type: audio/wav' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '<string>'import requests
url = "https://heardraft.com/api/v1/transcriptions"
payload = "<string>"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Length": "<content-length>",
"Authorization": "Bearer <token>",
"Content-Type": "audio/wav"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'Content-Length': '<content-length>',
Authorization: 'Bearer <token>',
'Content-Type': 'audio/wav'
},
body: '<string>'
};
fetch('https://heardraft.com/api/v1/transcriptions', 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://heardraft.com/api/v1/transcriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Length: <content-length>",
"Content-Type: audio/wav",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://heardraft.com/api/v1/transcriptions"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Content-Length", "<content-length>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "audio/wav")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://heardraft.com/api/v1/transcriptions")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Length", "<content-length>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "audio/wav")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://heardraft.com/api/v1/transcriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Length"] = '<content-length>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'audio/wav'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"id": "8b1e23fa-4c2b-4a8e-9b19-1d63df06a012",
"sourceId": "1f9c2810-79a4-4f25-8f55-c2e60ad1a4be",
"status": "ready",
"expiresAt": null,
"result": {
"text": "Welcome back everyone.\nLet's review the interview timeline before Friday.",
"durationSeconds": 142.4,
"segments": [
{
"text": "Let's review the interview timeline before Friday.",
"startMs": 4200,
"endMs": 8650,
"speaker": "Speaker 1"
}
]
},
"error": {
"code": "TRANSCRIPTION_FAILED",
"message": "Transcription could not finish."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}{
"error": {
"code": "INVALID_IDEMPOTENCY_KEY",
"message": "Send an Idempotency-Key with 8–128 letters, digits, dots, underscores or hyphens."
}
}Authorizations
Headers
Query Parameters
Body
audio/wavaudio/mpegaudio/mp4video/mp4application/octet-stream
Raw audio or video binary payload (up to 100 MB and 10 hours).
The body is of type file.
Response
Transcription task accepted and queued.