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

# View a list of faxes



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/real-time-communications/fax.yml get /faxes
openapi: 3.1.0
info:
  title: Telnyx Fax API
  version: 2.0.0
  description: API for Fax.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /faxes:
    get:
      tags:
        - Programmable Fax Commands
      summary: View a list of faxes
      operationId: ListFaxes
      parameters:
        - name: filter
          in: query
          style: deepObject
          explode: true
          description: >-
            Consolidated filter parameter (deepObject style). Originally:
            filter[created_at][gte], filter[created_at][gt],
            filter[created_at][lte], filter[created_at][lt],
            filter[direction][eq], filter[from][eq], filter[to][eq]
          schema:
            type: object
            properties:
              created_at:
                type: object
                properties:
                  gte:
                    type: string
                    format: date-time
                    example: '2020-02-02T22:25:27.521992Z'
                    description: >-
                      ISO 8601 date time for filtering faxes created after or on
                      that date
                  gt:
                    type: string
                    format: date-time
                    example: '2020-02-02T22:25:27.521992Z'
                    description: >-
                      ISO 8601 date time for filtering faxes created after that
                      date
                  lte:
                    type: string
                    format: date-time
                    example: '2020-02-02T22:25:27.521992Z'
                    description: >-
                      ISO 8601 formatted date time for filtering faxes created
                      on or before that date
                  lt:
                    type: string
                    format: date-time
                    example: '2020-02-02T22:25:27.521992Z'
                    description: >-
                      ISO 8601 formatted date time for filtering faxes created
                      before that date
                description: Date range filtering operations for fax creation timestamp
              direction:
                type: object
                properties:
                  eq:
                    type: string
                    example: inbound
                    description: >-
                      The direction, inbound or outbound, for filtering faxes
                      sent from this account
                description: Direction filtering operations
              from:
                type: object
                properties:
                  eq:
                    type: string
                    example: '+13127367276'
                    description: >-
                      The phone number, in E.164 format for filtering faxes sent
                      from this number
                description: From number filtering operations
              to:
                type: object
                properties:
                  eq:
                    type: string
                    example: '+13127367276'
                    description: >-
                      The phone number, in E.164 format for filtering faxes sent
                      to this number
                description: To number filtering operations
        - name: page
          in: query
          style: deepObject
          explode: true
          description: >-
            Consolidated pagination parameter (deepObject style). Originally:
            page[size], page[number]
          schema:
            type: object
            properties:
              size:
                type: integer
                example: 2
                description: Number of fax resources for the single page returned
              number:
                type: integer
                example: 2
                description: Number of the page to be retrieved
      responses:
        '200':
          $ref: '#/components/responses/ListFaxesResponse'
        '404':
          $ref: '#/components/responses/programmable-fax_NotFoundResponse'
        default:
          $ref: '#/components/responses/programmable-fax_GenericErrorResponse'
      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 fax of client.faxes.list()) {
              console.log(fax.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.faxes.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.Faxes.List(context.TODO(), telnyx.FaxListParams{})\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.faxes.FaxListPage;
            import com.telnyx.sdk.models.faxes.FaxListParams;

            public final class Main {
                private Main() {}

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

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

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

            page = telnyx.faxes.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->faxes->list(
                filter: [
                  'createdAt' => [
                    'gt' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
                    'gte' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
                    'lt' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
                    'lte' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
                  ],
                  'direction' => ['eq' => 'inbound'],
                  'from' => ['eq' => '+13127367276'],
                  'to' => ['eq' => '+13127367276'],
                ],
                pageNumber: 0,
                pageSize: 0,
              );

              var_dump($page);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx faxes list \
              --api-key 'My API Key'
components:
  responses:
    ListFaxesResponse:
      description: List faxes response
      content:
        application/json:
          schema:
            type: object
            title: List Faxes Response
            properties:
              data:
                type: array
                items:
                  $ref: '#/components/schemas/Fax'
              meta:
                $ref: '#/components/schemas/PaginationMeta'
    programmable-fax_NotFoundResponse:
      description: The requested resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/programmable-fax_Errors'
          example:
            errors:
              - code: '404'
                title: Not Found
                detail: The requested resource does not exist
    programmable-fax_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/programmable-fax_Errors'
  schemas:
    Fax:
      type: object
      properties:
        record_type:
          description: Identifies the type of the resource.
          type: string
          example: fax
          enum:
            - fax
        id:
          $ref: '#/components/schemas/Id'
        connection_id:
          $ref: '#/components/schemas/ConnectionId'
        direction:
          $ref: '#/components/schemas/Direction'
        media_url:
          $ref: '#/components/schemas/MediaUrl'
        media_name:
          $ref: '#/components/schemas/MediaName'
        to:
          $ref: '#/components/schemas/To'
        from:
          $ref: '#/components/schemas/From'
        from_display_name:
          description: >-
            The string used as the caller id name (SIP From Display Name)
            presented to the destination (`to` number).
          type: string
          example: Company Name
        quality:
          $ref: '#/components/schemas/Quality'
        status:
          description: Status of the fax
          type: string
          example: queued
          enum:
            - queued
            - media.processed
            - originated
            - sending
            - delivered
            - failed
            - initiated
            - receiving
            - media.processing
            - received
        webhook_url:
          description: URL that will receive fax webhooks
          type: string
        webhook_failover_url:
          description: >-
            Optional failover URL that will receive fax webhooks if webhook_url
            doesn't return a 2XX response
          type: string
        store_media:
          description: >-
            Should fax media be stored on temporary URL. It does not support
            media_name.
          type: boolean
        stored_media_url:
          description: >-
            If store_media was set to true, this is a link to temporary
            location. Link expires after 10 minutes.
          type: string
        preview_url:
          description: >-
            If `store_preview` was set to `true`, this is a link to temporary
            location. Link expires after 10 minutes.
          type: string
        client_state:
          description: State received from a command.
          type: string
          example: aGF2ZSBhIG5pY2UgZGF5ID1d
        created_at:
          description: ISO 8601 timestamp when resource was created
          type: string
          format: date-time
        updated_at:
          description: ISO 8601 timestamp when resource was updated
          type: string
          format: date-time
      example:
        record_type: fax
        id: 0ccc7b54-4df3-4bca-a65a-3da1ecc777f0
        connection_id: c-1
        direction: outbound
        from: '+123'
        to: '+456'
        media_url: http://www.example.com/fax.pdf
        store_media: true
        stored_media_url: >-
          https://s3.amazonaws.com/faxes-dev/user-1/cf4a6b52-bf8e-4945-9f49-611d0d2b083b.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxxxxxx%2F20200505%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200505T095917Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=fac2af40464fcc77673ad762db86e34f9c1b91a82699b5578c5327f53874df51
        preview_url: >-
          https://s3.amazonaws.com/faxes-dev/user-1/cf4a6b52-bf8e-4945-9f49-611d0d2b083b_preview.tiff?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxxxxxx%2F20200505%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200505T095917Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=fac2af40464fcc77673ad762db86e34f9c1b91a82699b5578c5327f53874df51
        quality: high
        webhook_url: http://www.example.com/webhooks
        webhook_failover_url: ''
        status: queued
        client_state: aGF2ZSBhIG5pY2UgZGF5ID1d
        created_at: '2020-05-05T09:59:12Z'
        updated_at: '2020-05-05T09:59:12Z'
    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
    programmable-fax_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/programmable-fax_Error'
      type: object
    Id:
      type: string
      format: uuid
      example: 0ccc7b54-4df3-4bca-a65a-3da1ecc777f0
      description: Identifies the type of resource.
    ConnectionId:
      description: The ID of the connection used to send the fax.
      type: string
      example: '234423'
    Direction:
      description: The direction of the fax.
      type: string
      example: outbound
      enum:
        - inbound
        - outbound
    MediaUrl:
      description: >-
        The URL (or list of URLs) to the PDF used for the fax's media. media_url
        and media_name/contents can't be submitted together.
      type: string
      example: https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf
    MediaName:
      description: >-
        The media_name used for the fax's media. Must point to a file previously
        uploaded to api.telnyx.com/v2/media by the same user/organization.
        media_name and media_url/contents can't be submitted together.
      type: string
      example: my_media_uploaded_to_media_storage_api
    To:
      description: The phone number, in E.164 format, the fax will be sent to or SIP URI
      type: string
      example: '+13127367276'
    From:
      description: The phone number, in E.164 format, the fax will be sent from.
      type: string
      example: '+13125790015'
    Quality:
      description: >-
        The quality of the fax. The `ultra` settings provides the highest
        quality available, but also present longer fax processing times.
        `ultra_light` is best suited for images, wihle `ultra_dark` is best
        suited for text.
      type: string
      example: high
      default: high
      enum:
        - normal
        - high
        - very_high
        - ultra_light
        - ultra_dark
    programmable-fax_Error:
      required:
        - code
        - title
      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
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````