> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Request recording for a call

> Starts recording with specified parameters for call idientified by call_sid.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/texml/recordings.yml post /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.json
openapi: 3.1.0
info:
  title: Telnyx TeXML Recordings API
  version: 2.0.0
  description: API for managing TeXML Recordings.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
tags:
  - name: Command
    description: TeXML command operations
  - name: Callbacks
    description: Webhook callbacks for call events
paths:
  /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.json:
    post:
      tags:
        - TeXML REST Commands
      summary: Request recording for a call
      description: >-
        Starts recording with specified parameters for call idientified by
        call_sid.
      operationId: StartTeXMLCallRecording
      parameters:
        - $ref: '#/components/parameters/AccountSid'
        - $ref: '#/components/parameters/CallSid'
      requestBody:
        $ref: '#/components/requestBodies/TexmlCreateCallRecordingRequest'
      responses:
        '200':
          $ref: '#/components/responses/TexmlCreateCallRecordingResponse'
        '404':
          $ref: '#/components/responses/call-scripting_NotFoundResponse'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            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);
        - lang: Python
          source: >-
            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)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Texml.Accounts.Calls.RecordingsJson.RecordingsJson(\n\t\tcontext.TODO(),\n\t\t\"call_sid\",\n\t\ttelnyx.TexmlAccountCallRecordingsJsonRecordingsJsonParams{\n\t\t\tAccountSid: \"account_sid\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.AccountSid)\n}\n"
        - lang: Java
          source: >-
            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);
                }
            }
        - lang: Ruby
          source: >-
            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)
        - lang: CLI
          source: |-
            telnyx texml:accounts:calls:recordings-json recordings-json \
              --api-key 'My API Key' \
              --account-sid account_sid \
              --call-sid call_sid
components:
  parameters:
    AccountSid:
      name: account_sid
      in: path
      required: true
      description: The id of the account the resource belongs to.
      schema:
        type: string
    CallSid:
      name: call_sid
      in: path
      required: true
      description: The CallSid that identifies the call to update.
      schema:
        type: string
  requestBodies:
    TexmlCreateCallRecordingRequest:
      content:
        application/x-www-form-urlencoded:
          schema:
            $ref: '#/components/schemas/TexmlCreateCallRecordingRequestBody'
      description: Starts call recording on a call.
  responses:
    TexmlCreateCallRecordingResponse:
      description: Successful call recording create response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TexmlCreateCallRecordingResponseBody'
    call-scripting_NotFoundResponse:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/call-scripting_ResourceNotFoundError'
  schemas:
    TexmlCreateCallRecordingRequestBody:
      type: object
      title: Texml Create Call Recording Request Body
      properties:
        PlayBeep:
          $ref: '#/components/schemas/PlayBeep'
        RecordingStatusCallbackEvent:
          $ref: '#/components/schemas/RecordingStatusCallbackEvent'
        RecordingStatusCallback:
          $ref: '#/components/schemas/TexmlStatusCallback'
        RecordingStatusCallbackMethod:
          $ref: '#/components/schemas/TexmlStatusCallbackMethod'
        RecordingChannels:
          $ref: '#/components/schemas/TexmlRecordingChannels'
        RecordingTrack:
          $ref: '#/components/schemas/RecordingTrack'
        SendRecordingUrl:
          $ref: '#/components/schemas/SendRecordingUrl'
    TexmlCreateCallRecordingResponseBody:
      type: object
      title: Texml Create Call Recording Response Body
      properties:
        account_sid:
          $ref: '#/components/schemas/AccountSid'
        call_sid:
          $ref: '#/components/schemas/CallControlId'
        conference_sid:
          $ref: '#/components/schemas/ConferenceSid'
        channels:
          $ref: '#/components/schemas/TwimlRecordingChannels'
        date_created:
          $ref: '#/components/schemas/DateTimeRFC2822'
        date_updated:
          $ref: '#/components/schemas/DateTimeRFC2822'
        start_time:
          $ref: '#/components/schemas/DateTimeRFC2822'
        price:
          $ref: '#/components/schemas/TexmlRecordingPrice'
        price_unit:
          $ref: '#/components/schemas/TexmlPriceUnit'
        duration:
          $ref: '#/components/schemas/TexmlRecordingDuration'
        sid:
          $ref: '#/components/schemas/TexmlSid'
        source:
          $ref: '#/components/schemas/RecordingSource'
        error_code:
          $ref: '#/components/schemas/TexmlErrorCode'
        track:
          $ref: '#/components/schemas/RecordingTrack'
        uri:
          type: string
          description: The relative URI for this recording resource.
          example: >-
            /v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls/v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA/Recordings/b08f0fa1-a32c-4218-b3b5-9cf78941ccac.json
    call-scripting_ResourceNotFoundError:
      type: object
      title: Resource not found
      example:
        errors:
          - detail: Resource not found
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
    PlayBeep:
      type: boolean
      description: Whether to play a beep when recording is started.
      example: false
      default: true
    RecordingStatusCallbackEvent:
      description: >-
        The changes to the recording's state that should generate a call to
        `RecoridngStatusCallback`. Can be: `in-progress`, `completed` and
        `absent`. Separate multiple values with a space. Defaults to
        `completed`.
      example: in-progress completed absent
      type: string
    TexmlStatusCallback:
      description: Url where status callbacks will be sent.
      example: http://webhook.com/callback
      type: string
      format: uri
    TexmlStatusCallbackMethod:
      description: HTTP method used to send status callbacks.
      example: GET
      type: string
      default: POST
      enum:
        - GET
        - POST
    TexmlRecordingChannels:
      type: string
      enum:
        - single
        - dual
      description: >-
        When `dual`, final audio file has the first leg on channel A, and the
        rest on channel B. `single` mixes both tracks into a single channel.
      example: single
      default: dual
    RecordingTrack:
      description: The audio track to record for the call. The default is `both`.
      example: inbound
      type: string
      enum:
        - inbound
        - outbound
        - both
    SendRecordingUrl:
      type: boolean
      description: Whether to send RecordingUrl in webhooks.
      example: false
      default: true
    AccountSid:
      type: string
      example: 61bf923e-5e4d-4595-a110-56190ea18a1b
    CallControlId:
      type: string
      example: v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA
    ConferenceSid:
      type:
        - string
        - 'null'
      format: uuid
      example: cd5a70f4-759b-4d5e-9c06-88c00f16f3c1
    TwimlRecordingChannels:
      type: integer
      enum:
        - 1
        - 2
      default: 2
      example: 1
    DateTimeRFC2822:
      type: string
      format: date-time
      example: '2023-08-11T19:12:11Z'
    TexmlRecordingPrice:
      type:
        - string
        - 'null'
      description: >-
        The price of this recording, the currency is specified in the price_unit
        field. 
      example: '0.10'
    TexmlPriceUnit:
      type:
        - string
        - 'null'
      description: The unit in which the price is given.
      example: USD
    TexmlRecordingDuration:
      type:
        - string
        - 'null'
      description: The duration of this recording, given in seconds.
      example: '12'
    TexmlSid:
      type: string
      description: Identifier of a resource.
      example: e9cea0be-7dbd-4b98-98b1-c0089d9d43b0
    RecordingSource:
      type: string
      description: Defines how the recording was created.
      enum:
        - StartCallRecordingAPI
        - StartConferenceRecordingAPI
        - OutboundAPI
        - DialVerb
        - Conference
        - RecordVerb
        - Trunking
    TexmlErrorCode:
      type:
        - string
        - 'null'
      example: null
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````