Create a recording for the call

POST /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings.json

A Recording resource represents the recording associated with a voice call, conference, or SIP Trunk.

Create a recording for the call

Path parameters

application/x-www-form-urlencoded

Body

  • The number of channels used in the recording. Can be: mono or dual and the default is mono. mono records all parties of the call into one channel. dual records each party of a 2-party call into separate channels.

  • The URL we should call using the recording_status_callback_method on each recording event specified in recording_status_callback_event. For more information, see RecordingStatusCallback parameters.

  • The recording status events on which we should call the recording_status_callback URL. Can be: in-progress, completed and absent and the default is completed. Separate multiple event values with a space.

  • The HTTP method we should use to call recording_status_callback. Can be: GET or POST and the default is POST.

    Values are HEAD, GET, POST, PATCH, PUT, or DELETE.

  • The audio track to record for the call. Can be: inbound, outbound or both. The default is both. inbound records the audio that is received by Twilio. outbound records the audio that is generated from Twilio. both records the audio that is received and generated by Twilio.

  • Trim string

    Whether to trim any leading and trailing silence in the recording. Can be: trim-silence or do-not-trim and the default is do-not-trim. trim-silence trims the silence from the beginning and end of the recording and do-not-trim does not.

Responses

  • 201

    Created

    Hide response attributes Show response attributes object
    • account_sid string | null

      The SID of the Account that created the resource

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • api_version string | null

      The API version used to make the recording

    • call_sid string | null

      The SID of the Call the resource is associated with

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^CA[0-9a-fA-F]{32}$.

    • channels integer | null

      The number of channels in the final recording file

    • conference_sid string | null

      The Conference SID that identifies the conference associated with the recording

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^CF[0-9a-fA-F]{32}$.

    • date_created string(date-time-rfc-2822) | null

      The RFC 2822 date and time in GMT that the resource was created

    • date_updated string(date-time-rfc-2822) | null

      The RFC 2822 date and time in GMT that the resource was last updated

    • duration string | null

      The length of the recording in seconds

    • How to decrypt the recording.

    • error_code integer | null

      More information about why the recording is missing, if status is absent.

    • price number | null

      The one-time cost of creating the recording.

    • price_unit string(currency) | null

      The currency used in the price property.

    • sid string | null

      The unique string that identifies the resource

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^RE[0-9a-fA-F]{32}$.

    • source string | null

      How the recording was created

      Values are DialVerb, Conference, OutboundAPI, Trunking, RecordVerb, StartCallRecordingAPI, or StartConferenceRecordingAPI.

    • start_time string(date-time-rfc-2822) | null

      The start time of the recording, given in RFC 2822 format

    • status string | null

      The status of the recording

      Values are in-progress, paused, stopped, processing, completed, or absent.

    • track string | null

      The recorded track. Can be: inbound, outbound, or both.

    • uri string(uri) | null

      The URI of the resource, relative to https://api.twilio.com

POST /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings.json
curl \
 -X POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings.json \
 --user "username:password" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d 'RecordingChannels=string&RecordingStatusCallback=https%3A%2F%2Fexample.com&RecordingStatusCallbackEvent=string&RecordingStatusCallbackMethod=HEAD&RecordingTrack=string&Trim=string'
Request example
{
  "RecordingChannels": "string",
  "RecordingStatusCallback": "https://example.com",
  "RecordingStatusCallbackEvent": [
    "string"
  ],
  "RecordingStatusCallbackMethod": "HEAD",
  "RecordingTrack": "string",
  "Trim": "string"
}
Response examples (201)
{
  "account_sid": "string",
  "api_version": "string",
  "call_sid": "string",
  "channels": 42,
  "conference_sid": "string",
  "date_created": "string",
  "date_updated": "string",
  "duration": "string",
  "error_code": 42,
  "price": 42.0,
  "price_unit": "string",
  "sid": "string",
  "source": "DialVerb",
  "start_time": "string",
  "status": "in-progress",
  "track": "string",
  "uri": "https://example.com"
}