Latest Legacy

Start recording a call

This endpoint lets you start recording a call.

API Endpoint

POST https://api.plivo.com/v1/Account/{auth_id}/Call/{call_uuid}/Record/

Arguments

time_limit integer

Sets the maximum duration, in seconds, of the recording.

Defaults to 60.

file_format string

The file format for the recording.

Allowed values: mp3 and wav
Default is mp3.

transcription_type string

auto: Transcription is automated; the turnaround time is under 5 minutes which linearly increases with call duration.

Transcription charges and details are available on our pricing page.

Note: Transcription service is available only in English, and limited to calls with a duration greater than 500 milliseconds and less than 4 hours, with a recording file size smaller than 2GB.
transcription_url stringCallback-retry configurable

The URL to which the transcription should be posted.

Note: The transcription information is sent to this URL via an HTTP POST callback.
callback_url stringCallback-retry configurable

The URL to be invoked when the recording ends. The details to be posted to the URL are documented in the Callback URL section below.

callback_method string

The HTTP verb used to invoke the callback_url.

Allowed values: GET, POST
Defaults to POST.

Callback URL

These details are posted when the callback URL is invoked after the recording ends.

List of parameters sent to the callback URL

api_id

The API ID that was returned by the Record API.

record_url

The URL where the recorded file can be accessed.

call_uuid

The call_uuid of the call on which this recording was made.

recording_id

The recording_id returned by the Record API.

recording_duration

The recording duration in seconds.

recording_duration_ms

The recording duration in milliseconds.

recording_start_ms

The start time of the recording since epoch in milliseconds.

recording_end_ms

The end time of the recording since epoch in milliseconds.

List of parameters sent to the transcription URL

transcription_charge

The credit deducted for the transcription.

transcription

The transcribed text of the recording.

duration

The duration in seconds of the recording.

call_uuid

The call UUID of the call that was transcribed.

transcription_rate

The rate of the transcription per minute.

recording_id

The recording ID of the transcribed recording.

error May be Recording duration too long for transcription or Recording file size too large for transcription. Empty if transcription is successful.
Note: .mp3 files are smaller in size than .wav files. Consider changing the recording file format to .mp3 if you see this error.

Returns

If successful, this endpoint returns an acknowledgement that the recording has started along with a URL to access the recording.

Response

HTTP Status Code: 202

{
  "url": "http://s3.amazonaws.com/recordings_2013/48dfaf60-3b2a-11e3.mp3",
  "message": "call recording started",
  "recording_id": "48dfaf60-3b2a-11e3",
  "api_id": "c7b69074-58be-11e1-86da-adf28403fe48"
}

Example Request

1
2
3
4
5
6
import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.calls.record(
    call_uuid='3a2e4c90-dcee-4931-8a59-f123ab507e60', )
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#
# Example for Call Record Create
#
require 'rubygems'
require 'plivo'

include Plivo
include Plivo::Exceptions

api = RestClient.new("<auth_id>","<auth_token>")

begin
  response = api.calls.record(
    'eba53b9e-8fbd-45c1-9444-696d2172fbc8'
  )
  puts response
rescue PlivoRESTError => e
  puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Example for Call Record create

var plivo = require('plivo');

(function main() {
    'use strict';
    
   // If auth id and auth token are not specified, Plivo will fetch them from the environment variables.
    var client = new plivo.Client("<auth_id>","<auth_token>");
    client.calls.record(
        "eba53b9e-8fbd-45c1-9444-696d2172fbc8", // call uuid
    ).then(function (response) {
        console.log(response);
    }, function (err) {
        console.error(err);
    });
})();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
/**
 * Example for Call Record create
 */
require 'vendor/autoload.php';
use Plivo\RestClient;
use Plivo\Exceptions\PlivoRestException;
$client = new RestClient("<auth_id>","<auth_token>");

try {
    $response = $client->calls->startRecording(
        'eba53b9e-8fbd-45c1-9444-696d2172fbc8'
    );
    print_r($response);
}
catch (PlivoRestException $ex) {
    print_r($ex);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.plivo.api.samples.call.record;

import java.io.IOException;
import com.plivo.api.Plivo;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.call.Call;
import com.plivo.api.models.call.actions.CallRecordCreateResponse;

/**
* Example for Call Record create
*/
class RecordCreate {
    public static void main(String [] args) {
        Plivo.init("<auth_id>","<auth_token>");
        try {
            CallRecordCreateResponse response = Call.recorder("eba53b9e-8fbd-45c1-9444-696d2172fbc8")
                .record();

            System.out.println(response);
        } catch (PlivoRestException | IOException e) {
            e.printStackTrace();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * Example for Call Record Create
 */
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;

namespace PlivoExamples
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var api = new PlivoApi("<auth_id>","<auth_token>");
            try
            {
                var response = api.Call.StartRecording(
                    callUuid:"10c94053-73b4-46fe-b74a-12159d1d3d60"
                );
                Console.WriteLine(response);
            }
            catch (PlivoRestException e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
        }
    }
}
1
2
3
4
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{"time_limit":"optional param in seconds"}' \
    https://api.plivo.com/v1/Account/{auth_id}/Call/{call_uuid}/Record/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Example for Call Record create
package main

import (
	"fmt"

	"github.com/plivo/plivo-go/v7"
)

func main() {
	client, err := plivo.NewClient("<auth_id>", "<auth_token>", &plivo.ClientOptions{})
	if err != nil {
		fmt.Print("Error", err.Error())
		return
	}
	response, err := client.Calls.Record(
		"eba53b9e-8fbd-45c1-9444-696d2172fbc8",
		plivo.CallRecordParams{},
	)
	if err != nil {
		fmt.Print("Error", err.Error())
		return
	}
	fmt.Printf("Response: %#v\n", response)
}