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

# List CDR usage reports

> Fetch all previous requests for cdr usage reports. 



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/account-billing/usage-reports.yml get /legacy_reporting/usage_reports/voice
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/usage_reports/voice:
    get:
      tags:
        - CDR Usage Reports
      summary: List CDR usage reports
      description: 'Fetch all previous requests for cdr usage reports. '
      operationId: getCdrUsageReports
      parameters:
        - name: page
          in: query
          description: Page number
          schema:
            minimum: 1
            type: integer
            format: int32
            default: 1
        - name: per_page
          in: query
          description: Size of the page
          schema:
            maximum: 250
            minimum: 1
            type: integer
            format: int32
            default: 20
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CdrGetUsageReportsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/standard_ErrorResponse'
      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
            });


            // Automatically fetches more pages as needed.

            for await (const cdrUsageReportResponseLegacy of
            client.legacy.reporting.usageReports.voice.list()) {
              console.log(cdrUsageReportResponseLegacy.id);
            }
        - 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
            )
            page = client.legacy.reporting.usage_reports.voice.list()
            page = page.data[0]
            print(page.id)
        - 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\tpage, err := client.Legacy.Reporting.UsageReports.Voice.List(context.TODO(), telnyx.LegacyReportingUsageReportVoiceListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\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.usagereports.voice.VoiceListPage;

            import
            com.telnyx.sdk.models.legacy.reporting.usagereports.voice.VoiceListParams;


            public final class Main {
                private Main() {}

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

                    VoiceListPage page = client.legacy().reporting().usageReports().voice().list();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            page = telnyx.legacy.reporting.usage_reports.voice.list

            puts(page)
        - 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 {
              $page = $client->legacy->reporting->usageReports->voice->list(
                page: 1, perPage: 1
              );

              var_dump($page);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx legacy:reporting:usage-reports:voice list \
              --api-key 'My API Key'
components:
  schemas:
    CdrGetUsageReportsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/CdrUsageReportResponseLegacy'
        meta:
          $ref: '#/components/schemas/standard_PaginationMeta'
    standard_ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/standard_Error'
          title: Errors
      title: ErrorResponse
    CdrUsageReportResponseLegacy:
      type: object
      properties:
        id:
          type: string
          description: Identifies the resource
          format: uuid
        start_time:
          type: string
          format: date-time
          example: '2018-02-02T22:25:27.521Z'
        end_time:
          type: string
          format: date-time
          example: '2018-02-02T22:25:27.521Z'
        connections:
          uniqueItems: true
          type: array
          example:
            - '1234567890'
            - '9876543210'
          items:
            type: string
        aggregation_type:
          type: integer
          description: >-
            Aggregation type: All = 0, By Connections = 1, By Tags = 2, By
            Billing Group = 3
          format: int32
        status:
          type: integer
          description: >-
            Status of the report: Pending = 1, Complete = 2, Failed = 3, Expired
            = 4
          format: int32
        report_url:
          type: string
          example: http://portal.telnyx.com/downloads/report_name_8hvb45Gu.csv
        result:
          type: object
        created_at:
          type: string
          format: date-time
          example: '2018-02-02T22:25:27.521Z'
        updated_at:
          type: string
          format: date-time
          example: '2018-02-02T22:25:27.521Z'
        record_type:
          type: string
          example: cdr_usage_report
        product_breakdown:
          type: integer
          description: >-
            Product breakdown type: No breakdown = 0, DID vs Toll-free = 1,
            Country = 2, DID vs Toll-free per Country = 3
          format: int32
      description: Legacy V2 CDR usage report response
    standard_PaginationMeta:
      type: object
      properties:
        total_pages:
          type: integer
          format: int32
          example: 3
        total_results:
          type: integer
          format: int32
          example: 55
        page_number:
          type: integer
          format: int32
          example: 2
        page_size:
          type: integer
          format: int32
          example: 25
    standard_Error:
      type: object
      properties:
        code:
          type: string
          title: Telnyx error code
        detail:
          type: string
          title: Error details
        title:
          type: string
          title: Error title
      required:
        - detail
      title: Error
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````