Request recording for a call
Starts recording with specified parameters for call idientified by call_sid.
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.texml.accounts.calls.recordingsJson.recordingsJson('call_sid', {
account_sid: 'account_sid',
});
console.log(response.account_sid);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.texml.accounts.calls.recordings_json.recordings_json(
call_sid="call_sid",
account_sid="account_sid",
)
print(response.account_sid)
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.Texml.Accounts.Calls.RecordingsJson.RecordingsJson(
context.TODO(),
"call_sid",
telnyx.TexmlAccountCallRecordingsJsonRecordingsJsonParams{
AccountSid: "account_sid",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.AccountSid)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.texml.accounts.calls.recordingsjson.RecordingsJsonRecordingsJsonParams;
import com.telnyx.sdk.models.texml.accounts.calls.recordingsjson.RecordingsJsonRecordingsJsonResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
RecordingsJsonRecordingsJsonParams params = RecordingsJsonRecordingsJsonParams.builder()
.accountSid("account_sid")
.callSid("call_sid")
.build();
RecordingsJsonRecordingsJsonResponse response = client.texml().accounts().calls().recordingsJson().recordingsJson(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.recordings_json.recordings_json("call_sid", account_sid: "account_sid")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->texml->accounts->calls->recordingsJson->recordingsJson(
'call_sid',
accountSid: 'account_sid',
playBeep: false,
recordingChannels: 'single',
recordingStatusCallback: 'http://webhook.com/callback',
recordingStatusCallbackEvent: 'in-progress completed absent',
recordingStatusCallbackMethod: 'GET',
recordingTrack: 'inbound',
sendRecordingURL: false,
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx texml:accounts:calls:recordings-json recordings-json \
--api-key 'My API Key' \
--account-sid account_sid \
--call-sid call_sidcurl --request POST \
--url https://api.telnyx.com/v2/texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data PlayBeep=false \
--data 'RecordingStatusCallbackEvent=in-progress completed absent' \
--data RecordingStatusCallback=http://webhook.com/callback \
--data RecordingStatusCallbackMethod=GET \
--data RecordingChannels=single \
--data RecordingTrack=inbound \
--data 'RecordingRedaction=pci,pii' \
--data SendRecordingUrl=false{
"account_sid": "61bf923e-5e4d-4595-a110-56190ea18a1b",
"call_sid": "v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA",
"conference_sid": "cd5a70f4-759b-4d5e-9c06-88c00f16f3c1",
"channels": 1,
"date_created": "2023-08-11T19:12:11Z",
"date_updated": "2023-08-11T19:12:11Z",
"start_time": "2023-08-11T19:12:11Z",
"price": "0.10",
"price_unit": "USD",
"duration": "12",
"sid": "e9cea0be-7dbd-4b98-98b1-c0089d9d43b0",
"source": "StartCallRecordingAPI",
"error_code": null,
"track": "inbound",
"uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls/v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA/Recordings/b08f0fa1-a32c-4218-b3b5-9cf78941ccac.json"
}{
"errors": [
{
"detail": "Resource not found"
}
]
}Authorizations
Path Parameters
The UUID of the Telnyx account that owns the resource, for example f5586561-8ff0-4291-a51b-c7dfe4139ff9. The account_sid path segment is kept for Twilio API compatibility, but the value is a Telnyx account UUID, not a Twilio AC... SID. It must match the account that owns the API key used to authenticate the request, otherwise the endpoint returns 404. The same value is sent as AccountSid in TeXML webhooks.
"f5586561-8ff0-4291-a51b-c7dfe4139ff9"
Body
Starts call recording on a call.
Silences spoken details of the given kinds in the recording: one or more of pci (card number, expiry date, security code), pii (personal details such as names, phone numbers, addresses and other identifying numbers) and phi (health details such as medications, doses and conditions), separated by commas, for example pci,pii. Redaction works on English speech only. Redacted recordings are charged at the Deepgram speech-to-text rate.
"pci,pii"
Response
Successful call recording create response
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.texml.accounts.calls.recordingsJson.recordingsJson('call_sid', {
account_sid: 'account_sid',
});
console.log(response.account_sid);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.texml.accounts.calls.recordings_json.recordings_json(
call_sid="call_sid",
account_sid="account_sid",
)
print(response.account_sid)
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.Texml.Accounts.Calls.RecordingsJson.RecordingsJson(
context.TODO(),
"call_sid",
telnyx.TexmlAccountCallRecordingsJsonRecordingsJsonParams{
AccountSid: "account_sid",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.AccountSid)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.texml.accounts.calls.recordingsjson.RecordingsJsonRecordingsJsonParams;
import com.telnyx.sdk.models.texml.accounts.calls.recordingsjson.RecordingsJsonRecordingsJsonResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
RecordingsJsonRecordingsJsonParams params = RecordingsJsonRecordingsJsonParams.builder()
.accountSid("account_sid")
.callSid("call_sid")
.build();
RecordingsJsonRecordingsJsonResponse response = client.texml().accounts().calls().recordingsJson().recordingsJson(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.recordings_json.recordings_json("call_sid", account_sid: "account_sid")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->texml->accounts->calls->recordingsJson->recordingsJson(
'call_sid',
accountSid: 'account_sid',
playBeep: false,
recordingChannels: 'single',
recordingStatusCallback: 'http://webhook.com/callback',
recordingStatusCallbackEvent: 'in-progress completed absent',
recordingStatusCallbackMethod: 'GET',
recordingTrack: 'inbound',
sendRecordingURL: false,
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx texml:accounts:calls:recordings-json recordings-json \
--api-key 'My API Key' \
--account-sid account_sid \
--call-sid call_sidcurl --request POST \
--url https://api.telnyx.com/v2/texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data PlayBeep=false \
--data 'RecordingStatusCallbackEvent=in-progress completed absent' \
--data RecordingStatusCallback=http://webhook.com/callback \
--data RecordingStatusCallbackMethod=GET \
--data RecordingChannels=single \
--data RecordingTrack=inbound \
--data 'RecordingRedaction=pci,pii' \
--data SendRecordingUrl=false{
"account_sid": "61bf923e-5e4d-4595-a110-56190ea18a1b",
"call_sid": "v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA",
"conference_sid": "cd5a70f4-759b-4d5e-9c06-88c00f16f3c1",
"channels": 1,
"date_created": "2023-08-11T19:12:11Z",
"date_updated": "2023-08-11T19:12:11Z",
"start_time": "2023-08-11T19:12:11Z",
"price": "0.10",
"price_unit": "USD",
"duration": "12",
"sid": "e9cea0be-7dbd-4b98-98b1-c0089d9d43b0",
"source": "StartCallRecordingAPI",
"error_code": null,
"track": "inbound",
"uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls/v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA/Recordings/b08f0fa1-a32c-4218-b3b5-9cf78941ccac.json"
}{
"errors": [
{
"detail": "Resource not found"
}
]
}