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

# Lists the phone numbers jobs



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/management-config.yml get /phone_numbers/jobs
openapi: 3.1.0
info:
  title: Telnyx Phone Number Management API
  version: 2.0.0
  description: API for managing and configuring phone numbers.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /phone_numbers/jobs:
    get:
      tags:
        - Bulk Phone Number Operations
      summary: Lists the phone numbers jobs
      operationId: ListPhoneNumbersJobs
      parameters:
        - $ref: '#/components/parameters/numbers_PageConsolidated'
        - name: sort
          in: query
          description: >-
            Specifies the sort order for results. If not given, results are
            sorted by created_at in descending order.
          required: false
          schema:
            type: string
            enum:
              - created_at
            example: created_at
        - name: filter
          in: query
          style: deepObject
          explode: true
          description: >-
            Consolidated filter parameter (deepObject style). Originally:
            filter[type]
          schema:
            type: object
            properties:
              type:
                type: string
                enum:
                  - update_emergency_settings
                  - delete_phone_numbers
                  - update_phone_numbers
                example: update_emergency_settings
                description: Identifies the type of the background job.
      responses:
        '200':
          $ref: '#/components/responses/ListPhoneNumbersJobsResponse'
        '400':
          $ref: '#/components/responses/numbers_BadRequestResponse'
        '401':
          $ref: '#/components/responses/numbers_UnauthorizedResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/numbers_Errors'
              examples:
                Invalid sorting value:
                  value:
                    errors:
                      - code: '10015'
                        title: Invalid sorting value
                        detail: >-
                          The value provided for sorting is not valid. Check the
                          value used and try again.
                        source:
                          pointer: /sort
                        meta:
                          url: >-
                            https://developers.telnyx.com/docs/overview/errors/10015
                Invalid page size:
                  value:
                    errors:
                      - code: '10015'
                        title: Invalid pagination
                        detail: >-
                          The provided 'page' parameter is invalid. It must be
                          an object with 'size' and/or 'number' with numeric
                          values.
                        source:
                          pointer: page/size
                        meta:
                          url: >-
                            https://developers.telnyx.com/docs/overview/errors/10015
                Invalid page number:
                  value:
                    errors:
                      - code: '10015'
                        title: Invalid pagination
                        detail: >-
                          The provided 'page' parameter is invalid. It must be
                          an object with 'size' and/or 'number' with numeric
                          values.
                        source:
                          pointer: page/number
                        meta:
                          url: >-
                            https://developers.telnyx.com/docs/overview/errors/10015
        '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 phoneNumbersJob of client.phoneNumbers.jobs.list())
            {
              console.log(phoneNumbersJob.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.phone_numbers.jobs.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.PhoneNumbers.Jobs.List(context.TODO(), telnyx.PhoneNumberJobListParams{})\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.phonenumbers.jobs.JobListPage;
            import com.telnyx.sdk.models.phonenumbers.jobs.JobListParams;

            public final class Main {
                private Main() {}

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

                    JobListPage page = client.phoneNumbers().jobs().list();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            page = telnyx.phone_numbers.jobs.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->phoneNumbers->jobs->list(
                filter: ['type' => 'update_emergency_settings'],
                pageNumber: 0,
                pageSize: 0,
                sort: 'created_at',
              );

              var_dump($page);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx phone-numbers:jobs 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:
    ListPhoneNumbersJobsResponse:
      description: Successful response with a list of phone numbers background jobs.
      content:
        application/json:
          schema:
            type: object
            title: List Phone Numbers Background Jobs Response
            properties:
              data:
                type: array
                items:
                  $ref: '#/components/schemas/PhoneNumbersJob'
              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_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
  schemas:
    numbers_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/numbers_Error'
      type: object
    PhoneNumbersJob:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 42587e44-3a3e-46de-9255-0c9a7a1d1ec7
          description: Identifies the resource.
          readOnly: true
        record_type:
          type: string
          example: phone_numbers_job
          description: Identifies the type of the resource.
          readOnly: true
        status:
          type: string
          enum:
            - pending
            - in_progress
            - completed
            - failed
            - expired
          default: pending
          example: pending
          description: Indicates the completion status of the background update.
          readOnly: true
        type:
          type: string
          enum:
            - update_emergency_settings
            - delete_phone_numbers
            - update_phone_numbers
          example: update_emergency_settings
          description: Identifies the type of the background job.
          readOnly: true
        etc:
          type: string
          format: date-time
          description: >-
            ISO 8601 formatted date indicating when the estimated time of
            completion of the background job.
          readOnly: true
        created_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was created.
          readOnly: true
        updated_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was updated.
          readOnly: true
        phone_numbers:
          type: array
          items:
            $ref: '#/components/schemas/PhoneNumbersJobPhoneNumber'
            description: The unique phone numbers given as arguments in the job creation.
        successful_operations:
          type: array
          items:
            $ref: '#/components/schemas/PhoneNumbersJobSuccessfulOperation'
            description: The phone numbers successfully updated.
          readOnly: true
        pending_operations:
          type: array
          items:
            $ref: '#/components/schemas/PhoneNumbersJobPendingOperation'
            description: >-
              The phone numbers pending confirmation on update results. Entries
              in this list are transient, and will be moved to either
              successful_operations or failed_operations once the processing is
              done.
          readOnly: true
        failed_operations:
          type: array
          items:
            $ref: '#/components/schemas/PhoneNumbersJobFailedOperation'
          readOnly: true
      example:
        id: 42587e44-3a3e-46de-9255-0c9a7a1d1ec7
        record_type: phone_numbers_job
        status: pending
        type: update_emergency_settings
        etc: '2020-10-30T18:10:00.000Z'
        created_at: '2020-10-23T18:10:00.000Z'
        updated_at: '2020-10-23T18:10:01.000Z'
        phone_numbers:
          - id: '2637816387126861836'
          - phone_number: '+19715555098'
          - phone_number: '+19705555099'
          - id: '3388768018273'
        successful_operations:
          - id: '2637816387126861836'
            phone_number: '+19705555098'
          - id: '33081887126861836'
            phone_number: '+19715555098'
        pending_operations:
          - id: '2637816387126861837'
            phone_number: '+19705555099'
        failed_operations:
          - id: '3388768018273'
            phone_number: '+19705551234'
            errors:
              - code: '10015'
                title: Bad Request
                detail: The field is invalid.
                source:
                  pointer: /emergency_address_id
    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_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
    PhoneNumbersJobPhoneNumber:
      properties:
        phone_number:
          type: string
          description: The phone number in e164 format.
          example: '+19705555000'
        id:
          type: string
          description: The phone number's ID
      type: object
    PhoneNumbersJobSuccessfulOperation:
      properties:
        phone_number:
          type: string
          description: The phone number in e164 format.
        id:
          type: string
          description: The phone number's ID
      type: object
    PhoneNumbersJobPendingOperation:
      properties:
        phone_number:
          type: string
          description: The phone number in e164 format.
        id:
          type: string
          description: The phone number's ID
      type: object
    PhoneNumbersJobFailedOperation:
      properties:
        phone_number:
          type: string
          description: The phone number in e164 format.
        id:
          type: string
          description: The phone number's ID
        errors:
          type: array
          items:
            $ref: '#/components/schemas/numbers_Error'
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````