> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.fax.plus/llms.txt
> Use this file to discover all available pages before exploring further.

# List phone numbers

> List your purchased/assigned phone numbers. For corporate members all assigned numbers will be returned, while for the corporate admin, all purchased numbers. (Permitted scopes: **fax:all:read**, **fax:numbers:read**)

<RequestExample>
  ```js NodeJS SDK theme={null}
  const axios = require('axios');
  const NumbersApiFp = require('@alohi/faxplus-api').NumbersApiFp;
  const Configuration = require('@alohi/faxplus-api').Configuration;

  const config = new Configuration({
      accessToken: accessToken,
      basePath: 'https://restapi.fax.plus/v3',
      // Header required only when using the OAuth2 token scheme
      baseOptions: {
          headers: {
            "x-fax-clientid": clientId,
          }
      }
  });

  async function listNumbers() {
      const reqParams = {
          "userId": '23415ufasx8df7'
      }
      const req = await NumbersApiFp(config).listNumbers(reqParams);
      const resp = await req(axios);
  }

  listNumbers()
  ```

  ```python Python SDK theme={null}
  from faxplus import ApiClient, NumbersApi
  from faxplus.configuration import Configuration

  conf = Configuration()
  conf.access_token = access_token
  # header_name and header_value required only when using the OAuth2 token scheme
  api_client = ApiClient(header_name='x-fax-clientid', header_value=client_id, configuration=conf)
  api = NumbersApi(api_client)
  resp = api.list_numbers(
      user_id='23415ufasx8df7')
  ```

  ```java Java theme={null}
  /**
   * Example below uses Apache HTTP Client 4 with Fluent API
   **/

  Map<String, String> pathParams = new HashMap<>();
  pathParams.put("user_id", "'23415ufasx8df7'");

  StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
  String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/numbers");

  String result = Request
      .Get(url)
       // The x-fax-clientid header is required only when using the OAuth2 token scheme
      .addHeader("x-fax-clientid", "YOUR CLIENT_ID")
      .addHeader("Accept", "'application/json'")
      .addHeader("Authorization", "'Bearer {access-token}'")
      .execute()
      .returnContent().asString();

  System.out.println(result.toString());
  ```

  ```go Go theme={null}
  package main

  import (
         "bytes"
         "net/http"
  )

  func main() {

      headers := map[string][]string{
          // The x-fax-clientid header is required only when using the OAuth2 token scheme
          "Accept": []string{"application/json"},
          "Authorization": []string{"Bearer {access-token}"},
          "x-fax-clientid": []string{"YOUR CLIENT_ID"}
      }

      data := bytes.NewBuffer([]byte{jsonReq})
      req, err := http.NewRequest("GET", "https://restapi.fax.plus/v3/accounts/{user_id}/numbers", data)
      req.Header = headers

      client := &http.Client{}
      resp, err := client.Do(req)
      // ...
  }
  ```

  ```php PHP theme={null}
  <?php

  require 'vendor/autoload.php';

  $headers = array(
      'Accept' => 'application/json',
      'Authorization' => 'Bearer {access-token}',
      // The x-fax-clientid header is required only when using the OAuth2 token scheme
      'x-fax-clientid' => '{client ID}',
  );

  $client = new GuzzleHttp\Client();

  try {
      $response = $client->request('GET','https://restapi.fax.plus/v3/accounts/{user_id}/numbers', array(
          'headers' => $headers,
          )
      );
      print_r($response->getBody()->getContents());
   }
   catch (GuzzleHttp\Exception\BadResponseException $e) {
      // handle exception or api errors.
      print_r($e->getMessage());
   }

   // ...
  ```

  ```bash cURL theme={null}
  # You can also use wget
  curl -X GET https://restapi.fax.plus/v3/accounts/{user_id}/numbers \
    -H 'Accept: application/json'  \
    -H 'Authorization: Bearer {access-token}' \
    # The x-fax-clientid header is required only when using the OAuth2 token scheme
    -H 'x-fax-clientid: "YOUR CLIENT_ID"'
  ```
</RequestExample>


## OpenAPI

````yaml get /accounts/{user_id}/numbers
openapi: 3.0.1
info:
  title: Fax.Plus REST API
  description: >-
    This is the Fax.Plus API v3 developed for third party developers and
    organizations. In order to have a better coding experience with this API,
    let's quickly go through some points:<br /><br /> - This API assumes
    **/accounts** as an entry point with the base url of
    **https://restapi.fax.plus/v3**. <br /><br /> - This API treats all date and
    times sent to it in requests as **UTC**. Also, all dates and times returned
    in responses are in **UTC**<br /><br /> - Once you have an access_token, you
    can easily send a request to the resource server with the base url of
    **https://restapi.fax.plus/v3** to access your permitted resources. As an
    example to get the user's profile info you would send a request to
    **https://restapi.fax.plus/v3/accounts/self** when **Authorization** header
    is set to **Bearer YOUR_ACCESS_TOKEN** and custom header of
    **x-fax-clientid** is set to YOUR_CLIENT_ID
  version: 3.4.0
  contact:
    name: Fax.Plus
    email: info@fax.plus
    url: https://github.com/alohi
servers:
  - url: https://restapi.fax.plus/v3
  - url: /v3
security: []
paths:
  /accounts/{user_id}/numbers:
    get:
      tags:
        - Numbers
      summary: List phone numbers
      description: >-
        List your purchased/assigned phone numbers. For corporate members all
        assigned numbers will be returned, while for the corporate admin, all
        purchased numbers. (Permitted scopes: **fax:all:read**,
        **fax:numbers:read**)
      operationId: listNumbers
      parameters:
        - description: >-
            ID of the user to get numbers for. Use 'self' for your own account,
            or provide a specific user ID for corporate member accounts.
          name: user_id
          in: path
          required: true
          schema:
            type: string
            default: self
          example: self
      responses:
        '200':
          $ref: '#/components/responses/NumberList'
        '400':
          $ref: '#/components/responses/Error'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - oauth2:
            - all
        - personal_access_token:
            - fax:all:read
            - fax:numbers:read
components:
  responses:
    NumberList:
      description: Response containing a list of number objects
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NumberList'
    Error:
      description: Error object in case there's a problem with given data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: invalid_user_id
            description: Invalid user id given
    ServerError:
      description: Error object in case there's a server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: internal_server_error
            description: An unexpected error happened, please contact support
  schemas:
    NumberList:
      description: List of numbers
      properties:
        numbers:
          items:
            $ref: '#/components/schemas/Number'
          type: array
      required:
        - numbers
      type: object
      additionalProperties: false
    Error:
      properties:
        description:
          type: string
        error:
          type: string
      additionalProperties: false
    Number:
      example:
        acquired_date: '2017-07-31 09:20:06'
        assigned_to:
          - 7724157c0974440293e45877c57f0703
        expiration_date: null
        id: e6e68ef87f0b8768ebacdb218994bfe7
        is_canceled: false
        notifications:
          - email: true
            push_notification: true
            type: voicemail
          - email: true
            push_notification: true
            type: receive_fax
          - email: true
            push_notification: true
            type: announcement
          - email: true
            push_notification: true
            type: callforward
        number: '+16699990000'
        owner_id: 7724157c0974440293e45877c57f0703
        status: active
      properties:
        acquired_date:
          description: Date and time at which the number was acquired
          type: string
        assigned_to:
          description: IDs of the user to whom this number is assigned
          items:
            minItems: 1
            type: string
          type: array
        expiration_date:
          description: Number expiration date, might be blank
          type: string
        id:
          description: Number ID
          type: string
        is_canceled:
          description: True if number is canceled but not yet deleted
          type: boolean
        notifications:
          items:
            properties:
              email:
                type: boolean
              push_notification:
                type: boolean
              type:
                type: string
          type: array
        number:
          pattern: ^[+][1-9][0-9]{1,14}$
          description: Fax number
          type: string
        owner_id:
          description: Number owner ID
          type: string
        status:
          $ref: '#/components/schemas/NumberStatus'
      required:
        - id
        - number
        - owner_id
        - status
        - assigned_to
        - acquired_date
      type: object
      additionalProperties: false
    NumberStatus:
      description: Status of your fax number e.g. active, inactive.
      type: string
      enum:
        - waiting_verification
        - active
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth2 Authorization Grant
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://accounts.fax.plus/login?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=http://localhost&scope=all
          tokenUrl: https://accounts.fax.plus/token
          refreshUrl: >-
            https://accounts.fax.plus/token?grant_type=refresh_token&refresh_token=YOUR_REFRESH_TOKEN
          scopes:
            all: >-
              for now when a user grants permission, all grants will be
              permitted
    personal_access_token:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Personal Access Token (PAT) is a Bearer token used for secure API calls.
        For direct API calls, the PAT is used in the Authorization header as
        'Bearer {PAT}'. For MCP usage, configure your PAT in your MCP client
        settings (e.g., in your IDE's MCP server configuration) - authentication
        will be handled automatically.

````