> ## 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 all addresses

> Returns a list of your addresses.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/account-billing/addresses.yml get /addresses
openapi: 3.1.0
info:
  title: Telnyx Addresses API
  version: 2.0.0
  description: API for Addresses.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /addresses:
    get:
      tags:
        - Addresses
      summary: List all addresses
      description: Returns a list of your addresses.
      operationId: FindAddresses
      parameters:
        - $ref: '#/components/parameters/PageConsolidated'
        - $ref: '#/components/parameters/FilterConsolidated'
        - $ref: '#/components/parameters/SortAddress'
      responses:
        '200':
          $ref: '#/components/responses/GetAllAddressResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Resource not found
      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 address of client.addresses.list()) {
              console.log(address.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.addresses.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.Addresses.List(context.TODO(), telnyx.AddressListParams{})\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.addresses.AddressListPage;
            import com.telnyx.sdk.models.addresses.AddressListParams;

            public final class Main {
                private Main() {}

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

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

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

            page = telnyx.addresses.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->addresses->list(
                filter: [
                  'addressBook' => ['eq' => 'eq'],
                  'customerReference' => 'string',
                  'streetAddress' => ['contains' => 'contains'],
                  'usedAsEmergency' => 'used_as_emergency',
                ],
                pageNumber: 0,
                pageSize: 0,
                sort: 'street_address',
              );

              var_dump($page);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx addresses 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[number], page[size]
      schema:
        type: object
        properties:
          number:
            type: integer
            minimum: 1
            default: 1
            description: The page number to load
          size:
            type: integer
            minimum: 1
            maximum: 250
            default: 20
            description: The size of the page
    FilterConsolidated:
      name: filter
      in: query
      style: deepObject
      explode: true
      description: >-
        Consolidated filter parameter (deepObject style). Originally:
        filter[customer_reference][eq], filter[customer_reference][contains],
        filter[used_as_emergency], filter[street_address][contains],
        filter[address_book][eq]
      schema:
        type: object
        properties:
          street_address:
            type: object
            properties:
              contains:
                type: string
                description: >-
                  If present, addresses with <code>street_address</code>
                  containing the given value will be returned. Matching is not
                  case-sensitive. Requires at least three characters.
          address_book:
            type: object
            properties:
              eq:
                type: string
                description: >-
                  If present, only returns results with the
                  <code>address_book</code> flag equal to the given value.
          customer_reference:
            oneOf:
              - type: string
                description: >-
                  If present, addresses with <code>customer_reference</code>
                  containing the given value will be returned. Matching is not
                  case-sensitive.
              - type: object
                properties:
                  eq:
                    type: string
                    description: Exact match for customer_reference.
                  contains:
                    type: string
                    description: >-
                      Partial match for customer_reference. Matching is not
                      case-sensitive.
          used_as_emergency:
            type: string
            description: >-
              If set as 'true', only addresses used as the emergency address for
              at least one active phone-number will be returned. When set to
              'false', the opposite happens: only addresses not used as the
              emergency address from phone-numbers will be returned.
    SortAddress:
      name: sort
      in: query
      required: false
      description: >-
        Specifies the sort order for results. By default sorting direction is
        ascending. To have the results sorted in descending order add the <code>
        -</code> prefix.<br/><br/>

        That is: <ul>
          <li>
            <code>street_address</code>: sorts the result by the
            <code>street_address</code> field in ascending order.
          </li>

          <li>
            <code>-street_address</code>: sorts the result by the
            <code>street_address</code> field in descending order.
          </li>
        </ul> <br/> If not given, results are sorted by <code>created_at</code>
        in descending order.
      schema:
        type: string
        enum:
          - created_at
          - first_name
          - last_name
          - business_name
          - street_address
        example: street_address
        default: created_at
  responses:
    GetAllAddressResponse:
      description: Successful response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  $ref: '#/components/schemas/Address'
              meta:
                $ref: '#/components/schemas/PaginationMeta'
  schemas:
    Address:
      type: object
      title: Address
      properties:
        id:
          type: string
          description: Uniquely identifies the address.
          example: '1293384261075731499'
          x-format: int64
        record_type:
          type: string
          description: Identifies the type of the resource.
          example: address
        customer_reference:
          $ref: '#/components/schemas/customer_reference'
        first_name:
          $ref: '#/components/schemas/first_name'
        last_name:
          $ref: '#/components/schemas/last_name'
        business_name:
          $ref: '#/components/schemas/business_name'
        phone_number:
          $ref: '#/components/schemas/phone_number'
        street_address:
          $ref: '#/components/schemas/street_address'
        extended_address:
          $ref: '#/components/schemas/extended_address'
        locality:
          $ref: '#/components/schemas/locality'
        administrative_area:
          $ref: '#/components/schemas/administrative_area'
        neighborhood:
          $ref: '#/components/schemas/neighborhood'
        borough:
          $ref: '#/components/schemas/borough'
        postal_code:
          $ref: '#/components/schemas/postal_code'
        country_code:
          $ref: '#/components/schemas/country_code'
        address_book:
          $ref: '#/components/schemas/address_book'
        validate_address:
          $ref: '#/components/schemas/validate_address'
        created_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2018-02-02T22:25:27.521Z'
        updated_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was updated.
          example: '2018-02-02T22:25:27.521Z'
    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
    customer_reference:
      type: string
      description: A customer reference string for customer look ups.
      example: MY REF 001
    first_name:
      type: string
      description: >-
        The first name associated with the address. An address must have either
        a first last name or a business name.
      example: Alfred
    last_name:
      type: string
      description: >-
        The last name associated with the address. An address must have either a
        first last name or a business name.
      example: Foster
    business_name:
      type: string
      description: >-
        The business name associated with the address. An address must have
        either a first last name or a business name.
      example: Toy-O'Kon
    phone_number:
      type: string
      description: The phone number associated with the address.
      example: '+12125559000'
    street_address:
      type: string
      description: The primary street address information about the address.
      example: 600 Congress Avenue
    extended_address:
      type: string
      description: >-
        Additional street address information about the address such as, but not
        limited to, unit number or apartment number.
      example: 14th Floor
    locality:
      type: string
      description: >-
        The locality of the address. For US addresses, this corresponds to the
        city of the address.
      example: Austin
    administrative_area:
      type: string
      description: >-
        The locality of the address. For US addresses, this corresponds to the
        state of the address.
      example: TX
    neighborhood:
      type: string
      description: >-
        The neighborhood of the address. This field is not used for addresses in
        the US but is used for some international addresses.
      example: Ciudad de los deportes
    borough:
      type: string
      description: >-
        The borough of the address. This field is not used for addresses in the
        US but is used for some international addresses.
      example: Guadalajara
    postal_code:
      type: string
      description: The postal code of the address.
      example: '78701'
    country_code:
      type: string
      description: The two-character (ISO 3166-1 alpha-2) country code of the address.
      example: US
    address_book:
      type: boolean
      description: >-
        Indicates whether or not the address should be considered part of your
        list of addresses that appear for regular use.
      example: false
      default: true
    validate_address:
      type: boolean
      description: >-
        Indicates whether or not the address should be validated for emergency
        use upon creation or not. This should be left with the default value of
        `true` unless you have used the `/addresses/actions/validate` endpoint
        to validate the address separately prior to creation. If an address is
        not validated for emergency use upon creation and it is not valid, it
        will not be able to be used for emergency services.
      example: true
      default: true
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````