Telnyx CDR Reports API

Voice batch detail records

OpenAPI Specification

telnyx-cdr-reports-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  contact:
    email: support@telnyx.com
  description: Telnyx provides global communications and connectivity APIs for developers — including SIP trunking, programmable voice, SMS, MMS, WhatsApp Business Messaging, Call Control, Fax, Wireless (IoT & eSIM), Phone Numbers (DID provisioning & porting), Emergency Services, and Network APIs for private interconnects and edge connectivity. Build, scale, and manage voice, messaging, and data networks with Telnyx's carrier-grade global infrastructure and API-first platform.
  title: Telnyx Access Tokens CDR Reports API
  version: 2.0.0
  x-endpoint-cost: light
servers:
- description: Version 2.0.0 of the Telnyx API
  url: https://api.telnyx.com/v2
security:
- bearerAuth: []
tags:
- description: Voice batch detail records
  name: CDR Reports
paths:
  /legacy/reporting/batch_detail_records/voice:
    get:
      description: Retrieves all CDR report requests for the authenticated user
      operationId: getCdrRequests
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CdrGetDetailReportResponse'
          description: CDR report requests retrieved successfully
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
      security:
      - bearerAuth: []
      summary: Get all CDR report requests
      tags:
      - CDR Reports
      x-latency-category: responsive
    post:
      description: Creates a new CDR report request with the specified filters
      operationId: submitCdrRequest
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CdrDetailedRequest'
        description: CDR detailed report request data
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CdrPostDetailReportResponse'
          description: CDR report request created successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
      security:
      - bearerAuth: []
      summary: Create a new CDR report request
      tags:
      - CDR Reports
      x-latency-category: responsive
  /legacy/reporting/batch_detail_records/voice/fields:
    get:
      description: Retrieves all available fields that can be used in CDR reports
      operationId: getCdrsAvailableFields
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CdrAvailableFieldsResponse'
          description: Available fields retrieved successfully
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
      security:
      - bearerAuth: []
      summary: Get available CDR report fields
      tags:
      - CDR Reports
      x-latency-category: responsive
  /legacy/reporting/batch_detail_records/voice/{id}:
    delete:
      description: Deletes a specific CDR report request by ID
      operationId: deleteCdrRequest
      parameters:
      - in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CdrDeleteDetailReportResponse'
          description: CDR report request deleted successfully
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Report not found
        '500':
          description: Internal server error
      security:
      - bearerAuth: []
      summary: Delete a CDR report request
      tags:
      - CDR Reports
      x-latency-category: responsive
    get:
      description: Retrieves a specific CDR report request by ID
      operationId: getCdrRequest
      parameters:
      - in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CdrGetDetailReportByIdResponse'
          description: CDR report request retrieved successfully
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Report not found
        '500':
          description: Internal server error
      security:
      - bearerAuth: []
      summary: Get a specific CDR report request
      tags:
      - CDR Reports
      x-latency-category: responsive
components:
  schemas:
    CdrDetailedRequest:
      description: Request object for CDR detailed report
      properties:
        call_types:
          description: List of call types to filter by (Inbound = 1, Outbound = 2)
          example:
          - 1
          - 2
          items:
            format: int32
            type: integer
          type: array
        connections:
          description: List of connections to filter by
          example:
          - 123
          - 456
          items:
            format: int64
            type: integer
          type: array
        end_time:
          description: End time in ISO format
          example: '2024-02-12T23:59:59Z'
          format: date-time
          type: string
        fields:
          description: Set of fields to include in the report
          example:
          - call_leg_id
          - start_time
          - end_time
          items:
            type: string
          type: array
        filters:
          description: List of filters to apply
          items:
            $ref: '#/components/schemas/Filter'
          type: array
        include_all_metadata:
          description: Whether to include all metadata
          example: true
          type: boolean
        managed_accounts:
          description: List of managed accounts to include
          example:
          - f47ac10b-58cc-4372-a567-0e02b2c3d479
          - 6ba7b810-9dad-11d1-80b4-00c04fd430c8
          items:
            format: uuid
            type: string
          type: array
        record_types:
          description: List of record types to filter by (Complete = 1, Incomplete = 2, Errors = 3)
          example:
          - 1
          - 2
          items:
            format: int32
            type: integer
          type: array
        report_name:
          description: Name of the report
          example: My CDR Report
          type: string
        select_all_managed_accounts:
          description: Whether to select all managed accounts
          example: false
          type: boolean
        source:
          description: 'Source of the report. Valid values: calls (default), call-control, fax-api, webrtc'
          example: calls
          type: string
        start_time:
          description: Start time in ISO format
          example: '2024-02-01T00:00:00Z'
          format: date-time
          type: string
        timezone:
          description: Timezone for the report
          example: UTC
          type: string
      required:
      - start_time
      - end_time
      type: object
    CdrGetDetailReportByIdResponse:
      properties:
        data:
          $ref: '#/components/schemas/CdrDetailedReqResponse'
      type: object
    CdrDeleteDetailReportResponse:
      properties:
        data:
          $ref: '#/components/schemas/CdrDetailedReqResponse'
      type: object
    CdrGetDetailReportResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/CdrDetailedReqResponse'
          type: array
        meta:
          $ref: '#/components/schemas/batch-csv_PaginationMeta'
      type: object
    Filter:
      description: 'Query filter criteria. Note: The first filter object must specify filter_type as ''and''. You cannot follow an ''or'' with another ''and''.'
      properties:
        billing_group:
          description: Billing group UUID to filter by
          example: adfaa016-f921-4b6c-97bb-e4c1dad231c5
          type: string
        cld:
          description: Called line identification (destination number)
          example: '+13129457420'
          type: string
        cld_filter:
          description: Filter type for CLD matching
          enum:
          - contains
          - starts_with
          - ends_with
          type: string
        cli:
          description: Calling line identification (caller ID)
          example: '+13129457420'
          type: string
        cli_filter:
          description: Filter type for CLI matching
          enum:
          - contains
          - starts_with
          - ends_with
          type: string
        filter_type:
          description: Logical operator for combining filters
          enum:
          - and
          - or
          type: string
        tags_list:
          description: Tag name to filter by
          example: tag1
          type: string
      type: object
    batch-csv_PaginationMeta:
      properties:
        page_number:
          example: 2
          format: int32
          type: integer
        page_size:
          example: 25
          format: int32
          type: integer
        total_pages:
          example: 3
          format: int32
          type: integer
        total_results:
          example: 55
          format: int32
          type: integer
      type: object
    CdrAvailableFieldsResponse:
      description: Available CDR report fields grouped by category
      properties:
        Billing:
          description: Cost and billing related information
          example:
          - billable_time
          - cost
          - rate
          - billing_group_id
          items:
            type: string
          type: array
        Interaction Data:
          description: Fields related to call interaction and basic call information
          example:
          - origination_number
          - terminating_number
          - start_timestamp_utc
          - start_timestamp
          - answer_timestamp
          - end_timestamp
          - direction
          items:
            type: string
          type: array
        Number Information:
          description: Geographic and routing information for phone numbers
          example:
          - origination_city
          - origination_state
          - origination_lata
          - origination_country
          - terminating_city
          - terminating_state
          items:
            type: string
          type: array
        Telephony Data:
          description: Technical telephony and call control information
          example:
          - route
          - connection_id
          - hangup_code
          - pdd
          - tags
          - sip_call_id
          - mos
          items:
            type: string
          type: array
      type: object
    CdrPostDetailReportResponse:
      properties:
        data:
          $ref: '#/components/schemas/CdrDetailedReqResponse'
      type: object
    CdrDetailedReqResponse:
      description: Response object for CDR detailed report
      properties:
        call_types:
          description: List of call types (Inbound = 1, Outbound = 2)
          items:
            description: Call type value
            format: int32
            type: integer
          type: array
        connections:
          description: List of connections
          example:
          - 123
          - 456
          items:
            description: List of connections
            format: int64
            type: integer
          type: array
        created_at:
          description: Creation date of the report
          example: '2024-02-12T14:00:00Z'
          type: string
        end_time:
          description: End time in ISO format
          example: '2024-02-12T23:59:59Z'
          type: string
        filters:
          description: List of filters
          items:
            $ref: '#/components/schemas/Filter'
          type: array
        id:
          description: Unique identifier for the report
          example: 123e4567-e89b-12d3-a456-426614174000
          type: string
        managed_accounts:
          description: List of managed accounts
          example:
          - f47ac10b-58cc-4372-a567-0e02b2c3d479
          - 6ba7b810-9dad-11d1-80b4-00c04fd430c8
          items:
            format: uuid
            type: string
          type: array
        record_type:
          example: cdr_detailed_report
          type: string
        record_types:
          description: List of record types (Complete = 1, Incomplete = 2, Errors = 3)
          example:
          - 1
          - 2
          items:
            description: Record type value
            format: int32
            type: integer
          type: array
        report_name:
          description: Name of the report
          example: My Report
          type: string
        report_url:
          description: URL to download the report
          type: string
        retry:
          description: Number of retries
          format: int32
          type: integer
        source:
          description: 'Source of the report. Valid values: calls (default), call-control, fax-api, webrtc'
          type: string
        start_time:
          description: Start time in ISO format
          example: '2024-02-01T00:00:00Z'
          type: string
        status:
          description: Status of the report (Pending = 1, Complete = 2, Failed = 3, Expired = 4)
          example: 1
          format: int32
          type: integer
        timezone:
          description: Timezone for the report
          type: string
        updated_at:
          description: Last update date of the report
          example: '2024-02-12T14:05:00Z'
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    branded-calling_bearerAuth:
      description: API key passed as a Bearer token in the Authorization header
      scheme: bearer
      type: http
    oauthClientAuth:
      description: OAuth 2.0 authentication for Telnyx API and MCP integrations
      flows:
        authorizationCode:
          authorizationUrl: https://api.telnyx.com/v2/oauth/authorize
          refreshUrl: https://api.telnyx.com/v2/oauth/token
          scopes:
            admin: Administrative access to Telnyx resources
          tokenUrl: https://api.telnyx.com/v2/oauth/token
        clientCredentials:
          scopes:
            admin: Administrative access to Telnyx resources
          tokenUrl: https://api.telnyx.com/v2/oauth/token
      type: oauth2
    outbound-voice-profiles_bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http
    pronunciation-dicts_bearerAuth:
      description: Telnyx API v2 key. Obtain from https://portal.telnyx.com
      scheme: bearer
      type: http
    stored-payment-transactions_bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http