Transcription start
Start real-time transcription. Transcription will stop on call hang-up, or can be initiated via the Transcription stop command.
Expected Webhooks:
call.transcription
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.calls.actions.startTranscription('call_control_id');
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.calls.actions.start_transcription(
call_control_id="call_control_id",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Calls.Actions.StartTranscription(
context.TODO(),
"call_control_id",
telnyx.CallActionStartTranscriptionParams{
TranscriptionStartRequest: telnyx.TranscriptionStartRequestParam{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.calls.actions.ActionStartTranscriptionParams;
import com.telnyx.sdk.models.calls.actions.ActionStartTranscriptionResponse;
import com.telnyx.sdk.models.calls.actions.TranscriptionStartRequest;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ActionStartTranscriptionParams params = ActionStartTranscriptionParams.builder()
.callControlId("call_control_id")
.transcriptionStartRequest(TranscriptionStartRequest.builder().build())
.build();
ActionStartTranscriptionResponse response = client.calls().actions().startTranscription(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.calls.actions.start_transcription("call_control_id")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Calls\Actions\GoogleTranscriptionLanguage;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->calls->actions->startTranscription(
'call_control_id',
clientState: 'aGF2ZSBhIG5pY2UgZGF5ID1d',
commandID: '891510ac-f3e4-11e8-af5b-de00688a4901',
transcriptionEngine: 'Google',
transcriptionEngineConfig: [
'enableSpeakerDiarization' => true,
'hints' => ['string'],
'interimResults' => true,
'language' => GoogleTranscriptionLanguage::EN,
'maxSpeakerCount' => 4,
'minSpeakerCount' => 4,
'model' => 'latest_long',
'profanityFilter' => true,
'speechContext' => [['boost' => 1, 'phrases' => ['string']]],
'transcriptionEngine' => 'Google',
'useEnhanced' => true,
],
transcriptionTracks: 'both',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx calls:actions start-transcription \
--api-key 'My API Key' \
--call-control-id call_control_idcurl --request POST \
--url https://api.telnyx.com/v2/calls/{call_control_id}/actions/transcription_start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transcription_engine": "Google",
"transcription_engine_config": {
"transcription_engine": "Google",
"language": "en"
},
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"command_id": "891510ac-f3e4-11e8-af5b-de00688a4901"
}
'{
"data": {
"result": "ok"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier and token for controlling the call
Body
Transcription start request
Engine to use for speech recognition. Legacy values A - Google, B - Telnyx are supported for backward compatibility.
Google, Telnyx, Deepgram, Azure, xAI, AssemblyAI, Speechmatics, Soniox, Parakeet, Humain, Reson8, Cohere, A, B "Google"
- Transcription engine Google config
- Transcription engine Telnyx config
- DeepgramNova2Config
- DeepgramNova3Config
- Transcription engine Azure config
- Transcription engine xAI config
- Transcription engine AssemblyAI config
- Transcription engine Speechmatics config
- Transcription engine Soniox config
- Transcription engine Parakeet config
- Transcription engine Humain config
- Transcription engine Reson8 config
- Transcription engine Cohere config
- Transcription engine A config
- Transcription engine B config
Show child attributes
Show child attributes
Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
"aGF2ZSBhIG5pY2UgZGF5ID1d"
Indicates which leg of the call will be transcribed. Use inbound for the leg that requested the transcription, outbound for the other leg, and both for both legs of the call. Will default to inbound.
"both"
Use this field to avoid duplicate commands. Telnyx will ignore any command with the same command_id for the same call_control_id.
"891510ac-f3e4-11e8-af5b-de00688a4901"
Response
Successful response upon making a call control command.
Show child attributes
Show child attributes
{ "result": "ok" }
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.calls.actions.startTranscription('call_control_id');
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.calls.actions.start_transcription(
call_control_id="call_control_id",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Calls.Actions.StartTranscription(
context.TODO(),
"call_control_id",
telnyx.CallActionStartTranscriptionParams{
TranscriptionStartRequest: telnyx.TranscriptionStartRequestParam{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.calls.actions.ActionStartTranscriptionParams;
import com.telnyx.sdk.models.calls.actions.ActionStartTranscriptionResponse;
import com.telnyx.sdk.models.calls.actions.TranscriptionStartRequest;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ActionStartTranscriptionParams params = ActionStartTranscriptionParams.builder()
.callControlId("call_control_id")
.transcriptionStartRequest(TranscriptionStartRequest.builder().build())
.build();
ActionStartTranscriptionResponse response = client.calls().actions().startTranscription(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.calls.actions.start_transcription("call_control_id")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Calls\Actions\GoogleTranscriptionLanguage;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->calls->actions->startTranscription(
'call_control_id',
clientState: 'aGF2ZSBhIG5pY2UgZGF5ID1d',
commandID: '891510ac-f3e4-11e8-af5b-de00688a4901',
transcriptionEngine: 'Google',
transcriptionEngineConfig: [
'enableSpeakerDiarization' => true,
'hints' => ['string'],
'interimResults' => true,
'language' => GoogleTranscriptionLanguage::EN,
'maxSpeakerCount' => 4,
'minSpeakerCount' => 4,
'model' => 'latest_long',
'profanityFilter' => true,
'speechContext' => [['boost' => 1, 'phrases' => ['string']]],
'transcriptionEngine' => 'Google',
'useEnhanced' => true,
],
transcriptionTracks: 'both',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx calls:actions start-transcription \
--api-key 'My API Key' \
--call-control-id call_control_idcurl --request POST \
--url https://api.telnyx.com/v2/calls/{call_control_id}/actions/transcription_start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transcription_engine": "Google",
"transcription_engine_config": {
"transcription_engine": "Google",
"language": "en"
},
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"command_id": "891510ac-f3e4-11e8-af5b-de00688a4901"
}
'{
"data": {
"result": "ok"
}
}