> ## 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 customer service records

> List customer service records.



## OpenAPI

````yaml /openapi/source/external/porting/customer_service_record.json get /customer_service_records
openapi: 3.1.0
info:
  version: 2.0.0
  title: Telnyx API
  x-latency-category: responsive
  description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services.
  license:
    name: MIT
    url: https://github.com/openai/openai-openapi/blob/master/LICENSE
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API
security:
  - bearerAuth: []
tags:
  - name: Customer Service Record
    description: Customer Service Record operations
  - name: Callbacks
    description: Callbacks
paths:
  /customer_service_records:
    get:
      tags:
        - Customer Service Record
      summary: List customer service records
      description: List customer service records.
      operationId: ListCustomerServiceRecords
      parameters:
        - $ref: '#/components/parameters/PageConsolidated'
        - $ref: '#/components/parameters/FilterConsolidated'
        - name: sort
          in: query
          style: deepObject
          explode: true
          description: >-
            Consolidated sort parameter (deepObject style). Originally:
            sort[value]
          schema:
            type: object
            properties:
              value:
                type: string
                enum:
                  - created_at
                  - '-created_at'
                example: created_at
                description: >-
                  Specifies the sort order for results. If not given, results
                  are sorted by created_at in descending order.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CustomerServiceRecord'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
        '401':
          $ref: '#/components/responses/UnauthorizedErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityErrorResponse'
        '500':
          $ref: '#/components/responses/UnexpectedErrorResponse'
      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 customerServiceRecord of
            client.customerServiceRecords.list()) {
              console.log(customerServiceRecord.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.customer_service_records.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.CustomerServiceRecords.List(context.TODO(), telnyx.CustomerServiceRecordListParams{})\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.customerservicerecords.CustomerServiceRecordListPage;

            import
            com.telnyx.sdk.models.customerservicerecords.CustomerServiceRecordListParams;


            public final class Main {
                private Main() {}

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

                    CustomerServiceRecordListPage page = client.customerServiceRecords().list();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            page = telnyx.customer_service_records.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->customerServiceRecords->list(
                filter: [
                  'createdAt' => [
                    'gt' => new \DateTimeImmutable('2020-01-01T00:00:00Z'),
                    'lt' => new \DateTimeImmutable('2020-01-01T00:00:00Z'),
                  ],
                  'phoneNumber' => ['eq' => '+12441239999', 'in' => ['+12441239999']],
                  'status' => ['eq' => 'pending', 'in' => ['pending']],
                ],
                pageNumber: 0,
                pageSize: 0,
                sort: ['value' => 'created_at'],
              );

              var_dump($page);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx customer-service-records list \
              --api-key 'My API Key'
components:
  parameters:
    PageConsolidated:
      name: page
      in: query
      style: deepObject
      explode: true
      description: >-
        Consolidated page parameter (deepObject style). Originally: page[size],
        page[number]
      schema:
        type: object
        properties:
          size:
            type: integer
            minimum: 1
            maximum: 250
            default: 20
            description: The size of the page
          number:
            type: integer
            minimum: 1
            default: 1
            description: The page number to load
    FilterConsolidated:
      name: filter
      in: query
      style: deepObject
      explode: true
      description: >-
        Consolidated filter parameter (deepObject style). Originally:
        filter[phone_number][eq], filter[phone_number][in][],
        filter[status][eq], filter[status][in][], filter[created_at][lt],
        filter[created_at][gt]
      schema:
        type: object
        properties:
          phone_number:
            type: object
            properties:
              eq:
                type: string
                example: '+12441239999'
                description: Filters records to those with a specified number.
              in:
                type: array
                items:
                  type: string
                  example: '+12441239999'
                description: Filters records to those with at least one number in the list.
          status:
            type: object
            properties:
              eq:
                type: string
                enum:
                  - pending
                  - completed
                  - failed
                example: pending
                description: Filters records to those with a specific status.
              in:
                type: array
                items:
                  type: string
                  enum:
                    - pending
                    - completed
                    - failed
                  example: pending
                description: Filters records to those with a least one status in the list.
          created_at:
            type: object
            properties:
              lt:
                type: string
                format: date-time
                example: '2020-01-01T00:00:00Z'
                description: Filters records to those created before a specific date.
              gt:
                type: string
                format: date-time
                example: '2020-01-01T00:00:00Z'
                description: Filters records to those created after a specific date.
  schemas:
    CustomerServiceRecord:
      type: object
      properties:
        id:
          description: Uniquely identifies this customer service record
          type: string
          format: uuid
          example: f1486bae-f067-460c-ad43-73a92848f902
          readOnly: true
        phone_number:
          description: The phone number of the customer service record.
          type: string
          example: '+12065551212'
        status:
          description: The status of the customer service record
          type: string
          enum:
            - pending
            - completed
            - failed
          example: completed
        error_message:
          description: >-
            The error message in case status is `failed`. This field would be
            null in case of `pending` or `completed` status.
          type:
            - string
            - 'null'
          example: CSR information not available.
        result:
          description: >-
            The result of the CSR request. This field would be null in case of
            `pending` or `failed` status.
          type:
            - object
            - 'null'
          properties:
            carrier_name:
              description: The name of the carrier that the customer service record is for.
              type: string
              example: ABC CARRIER, INC.
            associated_phone_numbers:
              description: The associated phone numbers of the customer service record.
              type: array
              items:
                type: string
                example: '+12065551212'
            admin:
              description: The admin of the customer service record.
              type: object
              properties:
                name:
                  description: The name of the customer service record.
                  type: string
                  example: John Doe
                billing_phone_number:
                  description: The billing phone number of the customer service record.
                  type: string
                  example: '+12065551212'
                account_number:
                  description: The account number of the customer service record.
                  type: string
                  example: '1234567890'
                authorized_person_name:
                  description: The authorized person name of the customer service record.
                  type: string
                  example: John Doe
            address:
              description: The address of the customer service record
              type: object
              properties:
                administrative_area:
                  description: The state of the address
                  type: string
                  example: NY
                locality:
                  description: The city of the address
                  type: string
                  example: New York
                postal_code:
                  description: The zip code of the address
                  type: string
                  example: '10001'
                street_address:
                  description: The street address
                  type: string
                  example: 123 Main St
                full_address:
                  description: The full address
                  type: string
                  example: 123 Main St; New York; NY; 10001
        webhook_url:
          type: string
          description: Callback URL to receive webhook notifications.
          example: https://example.com/webhook
        record_type:
          type: string
          example: customer_service_record
          description: Identifies the type of the resource.
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2021-03-19T10:07:15.527Z'
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2021-03-19T10:07:15.527Z'
          readOnly: true
    PaginationMeta:
      type: object
      properties:
        total_pages:
          type: integer
          example: 3
        total_results:
          type: integer
          example: 55
        page_number:
          type: integer
          example: 2
        page_size:
          type: integer
          example: 25
    UnauthorizedError:
      allOf:
        - $ref: '#/components/schemas/GenericError'
        - properties:
            code:
              example: '10009'
              type: string
            title:
              example: Authentication failed
              type: string
            detail:
              example: >-
                The required authentication headers were either invalid or not
                included in the request.
              type: string
            meta:
              type: object
              properties:
                url:
                  type: string
                  example: https://developers.telnyx.com/docs/overview/errors/10009
          type: object
    ForbiddenError:
      allOf:
        - $ref: '#/components/schemas/GenericError'
        - properties:
            code:
              example: '10010'
              type: string
            title:
              example: Authorization failed
              type: string
            detail:
              example: >-
                You do not have permission to perform the requested action on
                the specified resource or resources.
              type: string
            meta:
              type: object
              properties:
                url:
                  type: string
                  example: https://developers.telnyx.com/docs/overview/errors/10010
          type: object
    UnprocessableEntityError:
      allOf:
        - $ref: '#/components/schemas/GenericError'
        - properties:
            code:
              example: '10002'
              type: string
            title:
              example: Invalid phone number
              type: string
            detail:
              example: The phone number is invalid.
              type: string
            source:
              type: object
              properties:
                pointer:
                  type: string
                  example: /phone_numbers
            meta:
              type: object
              properties:
                url:
                  type: string
                  example: https://developers.telnyx.com/docs/overview/errors/10002
          type: object
    UnexpectedError:
      allOf:
        - $ref: '#/components/schemas/GenericError'
        - properties:
            code:
              example: '10007'
              type: string
            title:
              example: Unexpected error
              type: string
            detail:
              example: An unexpected error occurred.
              type: string
            meta:
              type: object
              properties:
                url:
                  type: string
                  example: https://developers.telnyx.com/docs/overview/errors/10007
          type: object
    GenericError:
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      type: object
  responses:
    UnauthorizedErrorResponse:
      description: >-
        The required authentication headers were either invalid or not included
        in the request.
      content:
        application/json:
          schema:
            properties:
              errors:
                type: array
                items:
                  $ref: '#/components/schemas/UnauthorizedError'
    ForbiddenErrorResponse:
      description: >-
        You do not have permission to perform the requested action on the
        specified resource or resources.
      content:
        application/json:
          schema:
            properties:
              errors:
                type: array
                items:
                  $ref: '#/components/schemas/ForbiddenError'
    UnprocessableEntityErrorResponse:
      description: Unprocessable entity. Check the 'detail' field in response for details.
      content:
        application/json:
          schema:
            properties:
              errors:
                type: array
                items:
                  $ref: '#/components/schemas/UnprocessableEntityError'
    UnexpectedErrorResponse:
      description: An unexpected error occurred.
      content:
        application/json:
          schema:
            properties:
              errors:
                type: array
                items:
                  $ref: '#/components/schemas/UnexpectedError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````