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

# List locations

> Returns all location objects, sorted by creation date (newest first). If no parameters are provided, results are paginated in pages of 30.



## OpenAPI

````yaml api-reference/anode/flatpeak-api-spec-anode.json GET /locations
openapi: 3.0.3
info:
  description: Flatpeak API
  version: 2025-09-14.anode
  title: Flatpeak API
  termsOfService: https://flatpeak.com/legal
  contact:
    name: Technical Support
    email: support@flatpeak.com
    url: https://flatpeak.com/contact
  license:
    name: Apache 2.0
    url: https://flatpeak.com/legal
servers:
  - url: https://api.flatpeak.com
    description: Location
security: []
tags:
  - name: Consumption
    description: Consumption operations
  - name: Customers
    description: Customer operations
  - name: Devices
    description: Device operations
  - name: Meters
    description: Meter readings operations
  - name: Events
    description: Events operations
  - name: Login
    description: Bearer auth token operations
  - name: Connect
    description: Connect operations
  - name: Locations
    description: Location operations
  - name: Rates
    description: Rates operations
  - name: Costs
    description: Consumption cost calculations
  - name: Schedules
    description: Consumption schedules
  - name: Tariffs
    description: Tariff operations
  - name: Slots
    description: Slots operations
externalDocs:
  description: Location documentation
  url: https://docs.flatpeak.com
paths:
  /locations:
    parameters: []
    get:
      tags:
        - Locations
      summary: List locations
      description: >-
        Returns all location objects, sorted by creation date (newest first). If
        no parameters are provided, results are paginated in pages of 30.
      operationId: list-locations
      parameters:
        - $ref: '#/components/parameters/reference_id'
        - $ref: '#/components/parameters/customer_id'
        - $ref: '#/components/parameters/starting_after'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/ending_before'
      responses:
        '200':
          $ref: '#/components/responses/LocationList'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
      security:
        - bearerAuth: []
components:
  parameters:
    reference_id:
      name: reference_id
      in: query
      required: false
      schema:
        type: string
      description: >-
        A reference that is meaningful to you, for example, an ID from your
        system.
    customer_id:
      name: customer_id
      in: query
      schema:
        type: string
        example: cus_65e421d1daa4a24082b4f590
      description: Flatpeak `customer_id`.
    starting_after:
      schema:
        type: string
      in: query
      name: starting_after
      description: >-
        Specifies a cursor for pagination use; provider_id defines the place in
        the list. To retrieve the next page in the list include starting_after
        where ID is the last ID in the currently retrieved list.
    limit:
      schema:
        type: integer
      in: query
      name: limit
      description: >-
        A limit on the number of objects to be returned. Can range between 1 and
        100, and the default is 30.
    ending_before:
      schema:
        type: string
      in: query
      name: ending_before
      description: >-
        Specifies a cursor for pagination use; provider_id defines the place in
        the list. To retrieve the previous page in the list, include
        ending_before, which is the first ID in the currently retrieved list.
  responses:
    '403':
      description: 403 forbidden
      content:
        application/json:
          schema:
            type: object
            x-examples:
              Example:
                message: Bad credentials
            properties:
              object:
                type: string
                example: error
                x-stoplight:
                  id: gria4ysjd9zhk
                default: error
              type:
                type: string
                x-stoplight:
                  id: 7mhtfljidnqcu
                example: invalid_request
                default: invalid_request
              code:
                type: string
                x-stoplight:
                  id: sy7ljpdy5wdes
                example: access_denied
                default: access_denied
              time_created:
                type: string
                x-stoplight:
                  id: 84d5biv9dfbc9
                format: date-time
                example: '2025-01-01T00:00:00Z'
            required:
              - object
              - type
              - code
          examples: {}
    '404':
      description: 404 response
      content:
        application/json:
          schema:
            type: object
            x-examples:
              Example:
                message: Not Found
            properties:
              object:
                type: string
                example: error
                x-stoplight:
                  id: qyc690tqd4dnh
                default: error
              type:
                type: string
                x-stoplight:
                  id: 6sog2aaccgb59
                example: invalid_request
                default: invalid_request
              code:
                type: string
                x-stoplight:
                  id: 6l9jrgodwxi0c
                example: not_found
                default: not_found
              time_created:
                type: string
                x-stoplight:
                  id: 1ywndy1nsshcz
                example: '2025-01-01T00:00:00Z'
                format: date-time
          examples: {}
    '429':
      description: 429 Too many requests
      content:
        application/json:
          schema:
            type: object
            properties:
              object:
                type: string
                x-stoplight:
                  id: irkmp11gg6sjx
                example: error
                default: error
              type:
                type: string
                x-stoplight:
                  id: u0gq12cizam3d
                default: rate_limit
                example: rate_limit
              code:
                type: string
                x-stoplight:
                  id: uh7x9404d4w3q
                default: too_many_requests
                example: too_many_requests
              message:
                type: string
                x-stoplight:
                  id: 9z8h79l1coblc
                default: Too many requests. Please retry after a short delay.
                example: Too many requests. Please retry after a short delay.
              time_created:
                type: string
                x-stoplight:
                  id: ea7o3uvdojrtc
                format: date-time
                default: '2026-01-29T17:11:52Z'
                example: '2026-01-29T17:11:52Z'
            required:
              - object
              - type
              - code
              - message
    LocationList:
      description: Response example
      content:
        application/json:
          schema:
            type: object
            properties:
              object:
                type: string
                x-stoplight:
                  id: bg1p9v02lpgo7
                description: Represents the object’s type. i.e. `list`.
                example: list
              url:
                type: string
                x-stoplight:
                  id: m91a6y1hctjkr
                description: Represents the URL slug for the object.
                example: /locations
              has_more:
                type: boolean
                x-stoplight:
                  id: zn0jxuw4gplgr
                description: Is set to `true` if more objects are available.
              data:
                type: array
                x-stoplight:
                  id: bitma8en99j8b
                items:
                  $ref: '#/components/schemas/Location'
            required:
              - object
              - url
              - has_more
              - data
  schemas:
    Location:
      type: object
      x-stoplight:
        id: uwi9ovzib5jb4
      x-examples: {}
      title: Location
      description: This object represents a supply address.
      x-tags:
        - Locations
      properties:
        id:
          type: string
          description: Flatpeak unique location ID
          example: loc_641b90b758fb8e6293716e40
        object:
          type: string
          description: Represents the object’s type. I.e. `location`.
          example: location
        reference_id:
          type: string
          description: >-
            A reference that is meaningful to you, for example, an ID from your
            system.
          x-stoplight:
            id: uhvd1tt1iqabo
          example: LOC1234567890
        customer_id:
          type: string
          description: Flatpeak customer ID.
          x-stoplight:
            id: uhvd1tt1iqabo
          example: cus_65e421d1daa4a24082b4f590
        live_mode:
          type: boolean
          description: >-
            Has the value `true` if the object exists in live mode or the value
            false if the object exists in test mode.
        timezone:
          type: string
          description: >-
            The timezone at the location, in 'tz database format'. I.e.
            'Europe/Berlin'.
          x-stoplight:
            id: aov8uxt6289sn
          example: Europe/London
        currency_code:
          type: string
          description: Currency at the location in ISO 4217.
          example: EUR
          x-stoplight:
            id: yjl56bkyw8d0f
        flex_allowed:
          type: boolean
          x-stoplight:
            id: 2t4k5o25rt75d
          description: >-
            When `false`, devices at this location cannot be subscribed to third
            party flexibility. 


            This parameter is in beta and is not enabled by default for all
            accounts. Contact support@flatpeak.com if you would like early
            access.
          default: true
        postal_address:
          $ref: '#/components/schemas/PostalAddress'
        geo_location:
          $ref: '#/components/schemas/GeoLocation'
        market_sources:
          type: object
          x-stoplight:
            id: dxge8dm1ucgh0
          description: >-
            Flatpeak IDs for market rates geographical regions. Flatpeak sets
            this automatically using the postal_address. For more information
            and to resolve IDs to region names, see the market rates reference
            in docs.ference in docs.
          properties:
            import:
              type: string
              x-stoplight:
                id: l5cdzkrjjd1mg
              example: mrs_65792b4ef61b16685ebd2ec1
              description: >-
                Flatpeak ID for market rates geographical region for import
                direction.
            export:
              type: string
              x-stoplight:
                id: wqiio52r4j8g7
              description: >-
                Flatpeak ID for market rates geographical region for export
                direction if an export tariff has been created.
        tariff_status:
          type: object
          x-stoplight:
            id: lwkb7g1qkapai
          description: Health status of tariff.
          properties:
            commodity_import:
              type: string
              x-stoplight:
                id: rr06lr4th2f4n
              example: CONNECTED
              description: Status of all COMMODITY/IMPORT tariff.
            commodity_export:
              type: string
              x-stoplight:
                id: ggpckds4cj8k4
              example: ERROR
              description: Status of all COMMODITY/EXPORT tariff.
            non_commodity_import:
              type: string
              x-stoplight:
                id: 6aqyxvmgkg8hc
              example: NOT_CONNECTED
              description: Status of all NON_COMMODITY/IMPORT tariffs.
            non_commodity_export:
              type: string
              x-stoplight:
                id: 5jhzcx06kppe3
              description: Status of all NON_COMMODITY/EXPORT tariffs.
              example: NOT_SUPPORTED
            local:
              type: string
              x-stoplight:
                id: wwywg3mzpqu7e
              description: Status of LOCAL tariff.
              example: NOT_SUPPORTED
        tariff_elements:
          type: array
          x-stoplight:
            id: xzt6lreurtp2g
          description: >-
            An array of tariffs that apply to this location. To manage, use the
            [tariffs](/api-reference/anode/tariffs) endpoints.
          items:
            x-stoplight:
              id: ed96ubaxsrght
            type: string
            example: trf_66ba584eb6923d7c3b942ef6
        time_created:
          type: string
          description: Time when the object was created, in UTC.
          format: date-time
        account_id:
          type: string
          x-stoplight:
            id: wg4bogwpe8daf
          example: acc_661677911f2197045e6cf1b1
          description: Flatpeak account ID.
      required:
        - id
        - object
        - live_mode
        - time_created
        - account_id
    PostalAddress:
      title: PostalAddress
      x-stoplight:
        id: c08e007sm4dhc
      type: object
      description: Information on the postal address.
      x-examples: {}
      properties:
        address_line1:
          type: string
          x-stoplight:
            id: y3w1smzzi7doq
          description: Address line 1 (e.g., street, PO Box, or company name).
          example: 1-3
        address_line2:
          type: string
          x-stoplight:
            id: d2a0gmwulev18
          description: Address line 2 (e.g., apartment, suite, unit, or building).
          example: Strand
        city:
          type: string
          x-stoplight:
            id: 6vwq2lw863yc5
          description: City, district, suburb, town, or village.
          example: London
        state:
          type: string
          x-stoplight:
            id: yjtu3ijseco94
          example: NSW
          description: >-
            State, county, province, or region. For
            [Australia](https://en.wikipedia.org/wiki/ISO_3166-2:AU),
            [Canada](https://en.wikipedia.org/wiki/ISO_3166-2:CA), and
            [US](https://en.wikipedia.org/wiki/ISO_3166-2:US), use ISO 3166-2
            state or province abbreviations (codes).
        post_code:
          type: string
          x-stoplight:
            id: 1styvjbg8556w
          description: ZIP or postal code.
          example: WC2N 5EH
        country_code:
          type: string
          x-stoplight:
            id: 53dqxz94xzzys
          description: >-
            Two-letter country code in [ISO 3166-1
            alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
          example: GB
    GeoLocation:
      title: GeoLocation
      x-stoplight:
        id: 5g5zsf24cp9v3
      type: object
      x-examples: {}
      description: >-
        Latitude and longitude of the location. Flatpeak resolves this
        automatically using the `postal_address` that you provide. This
        information is used to determine market price and carbon regions.
      properties:
        lat:
          x-stoplight:
            id: reqfsofuowtmf
          type: number
          example: 50.12345
        lng:
          type: number
          x-stoplight:
            id: za32cq461xz6a
          example: -1.23456
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate with `bearer` you obtained from
        [authentication](/api-reference/anode/authentication) endpoint.

````