> ## 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.

# Get available CDR report fields

> Retrieves all available fields that can be used in CDR reports



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/account-billing/usage-reports.yml get /legacy_reporting/batch_detail_records/voice/fields
openapi: 3.1.0
info:
  title: Telnyx Usage Reports API
  version: 2.0.0
  description: API for Usage reports.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /legacy_reporting/batch_detail_records/voice/fields:
    get:
      tags:
        - CDR Reports
      summary: Get available CDR report fields
      description: Retrieves all available fields that can be used in CDR reports
      operationId: getCdrsAvailableFields
      responses:
        '200':
          description: Available fields retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CdrAvailableFieldsResponse'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
      security:
        - bearerAuth: []
      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.legacy.reporting.batchDetailRecords.voice.retrieveFields();


            console.log(response.Billing);
        - 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.legacy.reporting.batch_detail_records.voice.retrieve_fields()

            print(response.billing)
        - 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.Legacy.Reporting.BatchDetailRecords.Voice.GetFields(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Billing)\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.legacy.reporting.batchdetailrecords.voice.VoiceRetrieveFieldsParams;

            import
            com.telnyx.sdk.models.legacy.reporting.batchdetailrecords.voice.VoiceRetrieveFieldsResponse;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    VoiceRetrieveFieldsResponse response = client.legacy().reporting().batchDetailRecords().voice().retrieveFields();
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            response =
            telnyx.legacy.reporting.batch_detail_records.voice.retrieve_fields


            puts(response)
        - lang: PHP
          source: >-
            <?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
                ->legacy
                ->reporting
                ->batchDetailRecords
                ->voice
                ->retrieveFields();

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx legacy:reporting:batch-detail-records:voice retrieve-fields \
              --api-key 'My API Key'
components:
  schemas:
    CdrAvailableFieldsResponse:
      type: object
      properties:
        Interaction Data:
          type: array
          description: Fields related to call interaction and basic call information
          items:
            type: string
          example:
            - origination_number
            - terminating_number
            - start_timestamp_utc
            - start_timestamp
            - answer_timestamp
            - end_timestamp
            - direction
        Number Information:
          type: array
          description: Geographic and routing information for phone numbers
          items:
            type: string
          example:
            - origination_city
            - origination_state
            - origination_lata
            - origination_country
            - terminating_city
            - terminating_state
        Telephony Data:
          type: array
          description: Technical telephony and call control information
          items:
            type: string
          example:
            - route
            - connection_id
            - hangup_code
            - pdd
            - tags
            - sip_call_id
            - mos
        Billing:
          type: array
          description: Cost and billing related information
          items:
            type: string
          example:
            - billable_time
            - cost
            - rate
            - billing_group_id
      description: Available CDR report fields grouped by category
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````