> ## 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 number reservations

> Gets a paginated list of phone number reservations.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/ordering.yml get /number_reservations
openapi: 3.1.0
info:
  title: Telnyx Phone Number Ordering API
  version: 2.0.0
  description: API for ordering phone numbers.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /number_reservations:
    get:
      tags:
        - Phone Number Reservations
      summary: List number reservations
      description: Gets a paginated list of phone number reservations.
      operationId: ListNumberReservations
      parameters:
        - $ref: '#/components/parameters/numbers_PageConsolidated'
        - name: filter
          in: query
          style: deepObject
          explode: true
          description: >-
            Consolidated filter parameter (deepObject style). Originally:
            filter[status], filter[created_at],
            filter[phone_numbers.phone_number], filter[customer_reference]
          schema:
            type: object
            properties:
              status:
                type: string
                description: Filter number reservations by status.
              created_at:
                type: object
                description: Filter number reservations by date range.
                properties:
                  gt:
                    type: string
                    description: Filter number reservations later than this value.
                  lt:
                    type: string
                    description: Filter number reservations earlier than this value.
                additionalProperties: false
              phone_numbers.phone_number:
                type: string
                description: Filter number reservations having these phone numbers.
              customer_reference:
                type: string
                description: Filter number reservations via the customer reference set.
      responses:
        '200':
          $ref: '#/components/responses/ListNumberReservationsResponse'
        '400':
          $ref: '#/components/responses/numbers_BadRequestResponse'
        '401':
          $ref: '#/components/responses/numbers_UnauthorizedResponse'
        '404':
          $ref: '#/components/responses/numbers_NotFoundResponse'
        '422':
          $ref: '#/components/responses/numbers_UnprocessableEntity'
        '500':
          $ref: '#/components/responses/numbers_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 numberReservation of
            client.numberReservations.list()) {
              console.log(numberReservation.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.number_reservations.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.NumberReservations.List(context.TODO(), telnyx.NumberReservationListParams{})\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.numberreservations.NumberReservationListPage;

            import
            com.telnyx.sdk.models.numberreservations.NumberReservationListParams;


            public final class Main {
                private Main() {}

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

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

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

            page = telnyx.number_reservations.list

            puts(page)
        - lang: CLI
          source: |-
            telnyx number-reservations list \
              --api-key 'My API Key'
components:
  parameters:
    numbers_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
  responses:
    ListNumberReservationsResponse:
      description: Successful response with a list of number reservations.
      content:
        application/json:
          schema:
            type: object
            title: List Number Reservations Response
            properties:
              data:
                type: array
                items:
                  $ref: '#/components/schemas/NumberReservation'
              meta:
                $ref: '#/components/schemas/PaginationMeta'
    numbers_BadRequestResponse:
      description: >-
        Bad request, the request was unacceptable, often due to missing a
        required parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
    numbers_UnauthorizedResponse:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
          examples:
            Authentication Failed:
              value:
                errors:
                  - code: '10009'
                    title: Authentication failed
                    detail: Could not understand the provided credentials.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10009
    numbers_NotFoundResponse:
      description: The requested resource doesn't exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
    numbers_UnprocessableEntity:
      description: Unprocessable entity. Check the 'detail' field in response for details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
    numbers_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
  schemas:
    NumberReservation:
      properties:
        id:
          type: string
          format: uuid
          example: 12ade33a-21c0-473b-b055-b3c836e1c292
          readOnly: true
        record_type:
          type: string
          example: number_reservation
          readOnly: true
        phone_numbers:
          type: array
          items:
            $ref: '#/components/schemas/ReservedPhoneNumber'
        status:
          type: string
          enum:
            - pending
            - success
            - failure
          description: The status of the entire reservation.
          readOnly: true
        customer_reference:
          type: string
          description: A customer reference string for customer look ups.
          example: MY REF 001
        created_at:
          type: string
          format: date-time
          description: >-
            An ISO 8901 datetime string denoting when the numbers reservation
            was created.
          example: '2018-01-01T00:00:00.000000Z'
          readOnly: true
        errors:
          type: string
          description: Errors the reservation could happen upon
          example: Number is already on hold
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: >-
            An ISO 8901 datetime string for when the number reservation was
            updated.
          example: '2018-01-01T00:00:00.000000Z'
          readOnly: true
      example:
        id: 12ade33a-21c0-473b-b055-b3c836e1c292
        record_type: number_reservation
        phone_numbers:
          - id: 12ade33a-21c0-473b-b055-b3c836e1c292
            record_type: reserved_phone_number
            phone_number: '+19705555098'
            status: pending
            created_at: '2018-01-01T00:00:00.000000Z'
            updated_at: '2018-01-01T00:00:00.000000Z'
            expired_at: '2018-01-01T00:00:00.000000Z'
            errors: Number is already on hold
        status: pending
        customer_reference: MY REF 001
        created_at: '2018-01-01T00:00:00.000000Z'
        updated_at: '2018-01-01T00:00:00.000000Z'
      type: object
    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
    numbers_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/numbers_Error'
      type: object
    ReservedPhoneNumber:
      properties:
        id:
          type: string
          format: uuid
          example: 12ade33a-21c0-473b-b055-b3c836e1c292
          readOnly: true
        errors:
          type: string
          description: Errors the reservation could happen upon
          example: Number is already on hold
          readOnly: true
        record_type:
          type: string
          example: reserved_phone_number
          readOnly: true
        phone_number:
          type: string
          example: '+19705555098'
        status:
          type: string
          enum:
            - pending
            - success
            - failure
          description: The status of the phone number's reservation.
          example: success
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: >-
            An ISO 8901 datetime string denoting when the individual number
            reservation was created.
          example: '2018-01-01T00:00:00.000000Z'
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: >-
            An ISO 8901 datetime string for when the the individual number
            reservation was updated.
          example: '2018-01-01T00:00:00.000000Z'
          readOnly: true
        expired_at:
          type: string
          format: date-time
          description: >-
            An ISO 8901 datetime string for when the individual number
            reservation is going to expire
          example: '2018-01-01T00:00:00.000000Z'
          readOnly: true
      example:
        id: 12ade33a-21c0-473b-b055-b3c836e1c292
        record_type: reserved_phone_number
        phone_number: '+19705555098'
        status: pending
        created_at: '2018-01-01T00:00:00.000000Z'
        updated_at: '2018-01-01T00:00:00.000000Z'
        expired_at: '2018-01-01T00:00:00.000000Z'
      type: object
    numbers_Error:
      properties:
        code:
          type: string
          example: '10007'
        title:
          type: string
          example: Unexpected error
        detail:
          type: string
          example: An unexpected error occured.
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              example: /base
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          properties:
            url:
              type: string
              description: URL with additional information on the error.
              example: https://developers.telnyx.com/docs/overview/errors/10015
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````