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

# Retrieve a location

> Retrieves the location a device sits behind, from the device's `location_id`. Returns `404` unless at least one device at the location is connected to your account.



## OpenAPI

````yaml fleet-api/reference/flatpeak-api-spec-fleet.json GET /locations/{location_id}
openapi: 3.0.3
info:
  description: >-
    The Flatpeak Fleet API. VPP operators use it to enroll, dispatch and settle
    OEM device fleets.


    ## Authentication

    Exchange your `account_id` and `secret_key` for a bearer token at `POST
    /auth/tokens` with basic auth. Send it as `Authorization: Bearer <token>` on
    every request.


    ## Base URL

    `https://fleet-api.flatpeak.com`


    ## Pagination

    Lists return `data`, `next_cursor` and `url`. Pass `next_cursor` as `cursor`
    until it is `null`. A cursor is opaque and bound to the endpoint and query
    parameters that issued it.


    ## Errors

    Every non-2xx response carries `object`, `type`, `code` and `message`.
    Branch on `code`.


    ## Money and energy

    Money is a decimal number paired with a `currency_code` (ISO 4217). Power is
    in kW and energy in kWh. Positive is import, negative is export.


    ## Live and test

    `live_mode` marks live or test data.
  version: 2027-01-01.busbar
  title: Flatpeak Fleet 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://fleet-api.flatpeak.com
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: >-
      Exchange your account credentials for a bearer token to authenticate API
      requests.
  - name: Connect
    description: >-
      Create and retrieve Connect sessions for onboarding customers through your
      own app.
  - name: OEMs
    description: List and retrieve the OEMs whose devices your fleet can reach.
  - name: Devices
    description: >-
      Retrieve, list and update the devices connected to your account, and read
      their consent history and shared settings.
  - name: Locations
    description: >-
      Read the location a device sits behind: its timezone, currency, metering
      and your devices there.
  - name: Dispatch
    description: Submit plans to devices on managed tariffs and read the dispatch timeline.
  - name: Telemetry
    description: Read device state, device meter records and location meter records.
  - name: Tariffs
    description: Create, retrieve, delete, and list tariffs.
  - name: Events
    description: Retrieve and list account events.
  - name: VPP Programs
    description: >-
      Define and manage VPP programs: the commercial terms devices enroll under,
      and their live state.
  - name: Groups
    description: >-
      Named collections of devices for bulk dispatch and aggregated reads. OEMs
      see them read-only as [groups](/energy-api/reference/groups/list) on the
      Energy API.
  - name: Zones
    description: >-
      Network areas resolved to devices by Flatpeak, for locational eligibility
      and grouping without handling addresses.
  - name: Exports
    description: >-
      Package settlement evidence, consent records and enrollment registers as
      downloadable files.
  - name: Rewards
    description: >-
      The reward ledger: entries accrue from delivery, you approve them, pay the
      customers and mark them paid.
  - name: VPP Enrollments
    description: Track and act on device enrollments across your programs.
  - name: VPP Events
    description: >-
      Commit market activations: create an event for a group, then read its
      state and its devices' results.
externalDocs:
  description: Documentation
  url: https://docs.flatpeak.com
paths:
  /locations/{location_id}:
    parameters:
      - schema:
          type: string
        name: location_id
        in: path
        required: true
        description: Flatpeak Location ID, from the Device object.
    get:
      tags:
        - Locations
      summary: Retrieve a location
      description: >-
        Retrieves the location a device sits behind, from the device's
        `location_id`. Returns `404` unless at least one device at the location
        is connected to your account.
      operationId: get-location
      parameters: []
      responses:
        '200':
          $ref: '#/components/responses/Location'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
components:
  responses:
    '401':
      description: '401 Unauthorized: authentication credentials are missing or invalid.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '403':
      description: '403 Forbidden: you do not have permission to access this resource.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '404':
      description: '404 Not Found: the requested resource does not exist.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '429':
      description: '429 Too Many Requests: the rate limit has been exceeded.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '500':
      description: >-
        500 Internal Server Error: an unexpected error occurred. Safe to retry
        with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '503':
      description: >-
        503 Service Unavailable: the service is temporarily down for
        maintenance. Retry after the indicated delay.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Location:
      description: Location response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Location'
          example:
            id: loc_641b90b758fb8e6293716e40
            object: location
            live_mode: true
            oem_id: oem_6a3a8dada72cd0a249ff9528
            timezone: America/Los_Angeles
            currency_code: USD
            postal_address:
              address_line1: 1 Main Street
              city: Sacramento
              state: CA
              post_code: '95814'
              country_code: US
            geo_location:
              lat: 38.581572
              lng: -121.4944
            metering:
              device_id: dev_63a6087272941ef077a8fd3e
              conflict: false
            device_ids:
              - dev_63a6087272941ef077a8fd3e
            time_created: '2026-01-20T09:30:00Z'
  schemas:
    Location:
      title: Location
      type: object
      description: >-
        The property a device sits behind, as far as the customer's consents let
        you see it. The OEM creates locations. Read one for its timezone,
        currency, metering and your devices there.
      properties:
        id:
          type: string
          description: Flatpeak Location ID.
          example: loc_65e42ce4d3b813479b252160
          pattern: ^[a-z]{2,4}_[A-Za-z0-9]+$
        object:
          type: string
          description: Object type, `location`.
          example: location
          enum:
            - location
        live_mode:
          type: boolean
          description: '`true` for live data, `false` for test data.'
        oem_id:
          type: string
          pattern: ^oem_[A-Za-z0-9]+$
          example: oem_6a3a8dada72cd0a249ff9528
          description: >-
            Flatpeak OEM ID: the OEM whose account holds the location. A
            household with devices from two OEMs has a location under each. See
            [list all OEMs](/fleet-api/reference/oems/list).
        timezone:
          type: string
          description: IANA timezone at the location.
          example: Europe/London
        currency_code:
          type: string
          description: ISO 4217 currency of the location's market.
          example: GBP
          pattern: ^[A-Z]{3}$
        postal_address:
          type: object
          nullable: true
          readOnly: true
          description: >-
            Postal address of the location. Populated only when a device there
            has granted you the `LOCATION` consent scope; `null` otherwise.
          allOf:
            - $ref: '#/components/schemas/PostalAddress'
        geo_location:
          type: object
          nullable: true
          readOnly: true
          description: >-
            Geographic coordinates of the location. Populated only when a device
            there has granted you the `LOCATION` consent scope; `null`
            otherwise.
          allOf:
            - $ref: '#/components/schemas/GeoLocation'
        metering:
          $ref: '#/components/schemas/LocationMetering'
        device_ids:
          type: array
          items:
            type: string
          description: >-
            Flatpeak Device IDs at the location that are connected to your
            account. Devices connected to other accounts are never listed.
          example:
            - dev_63a6087272941ef077a8fd3e
        time_created:
          type: string
          format: date-time
          description: Time when the object was created, in UTC.
          example: '2026-07-08T11:25:39Z'
      required:
        - id
        - object
        - live_mode
        - oem_id
        - timezone
        - currency_code
        - postal_address
        - geo_location
        - metering
        - device_ids
        - time_created
    Error:
      type: object
      description: Standard error envelope returned by every non-2xx response.
      required:
        - object
        - type
        - code
        - message
      properties:
        object:
          type: string
          enum:
            - error
          default: error
          description: Object type.
        type:
          type: string
          description: High-level error category.
          example: invalid_request
        code:
          type: string
          description: Machine-readable error code, safe to branch on.
          example: access_denied
        message:
          type: string
          description: Human-readable description of the error.
          example: The requested resource could not be found.
        context:
          type: string
          description: Optional originating context, for example `api.price_get`.
          example: api.price_get
        live_mode:
          type: boolean
          description: Whether the error occurred against live or test data.
        time_created:
          type: string
          format: date-time
          description: Time the error was generated (RFC 3339).
          example: '2026-01-01T00:00:00Z'
    PostalAddress:
      title: PostalAddress
      type: object
      description: Information on the postal address.
      properties:
        address_line1:
          type: string
          description: Address line 1 (for example street, PO Box, or company name).
          example: 1-3
        address_line2:
          type: string
          description: Address line 2 (for example apartment, suite, unit, or building).
          example: Strand
        city:
          type: string
          description: City, district, suburb, town, or village.
          example: London
        state:
          type: string
          example: NSW
          description: >-
            State, county, province or region. For Australia, Canada and the US,
            use ISO 3166-2 codes.
          nullable: true
        post_code:
          type: string
          description: ZIP or postal code.
          example: WC2N 5EH
        country_code:
          type: string
          description: >-
            Two-letter country code in [ISO 3166-1
            alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
          example: GB
          pattern: ^[A-Z]{2}$
    GeoLocation:
      title: GeoLocation
      type: object
      description: >-
        Latitude and longitude of the device's location, resolved by Flatpeak
        from the enrollment address.
      properties:
        lat:
          type: number
          example: 50.12345
          description: Latitude in decimal degrees.
        lng:
          type: number
          example: -1.23456
          description: Longitude in decimal degrees.
    LocationMetering:
      type: object
      title: LocationMetering
      readOnly: true
      additionalProperties: false
      description: Who meters the location's grid connection point, as the OEM declares it.
      required:
        - device_id
        - conflict
      properties:
        device_id:
          type: string
          nullable: true
          example: dev_63a6087272941ef077a8fd3e
          description: >-
            The device that measures the grid connection point and submits
            location meter records. `null` when no device at the location meters
            it, in which case the location has no meter records.
        conflict:
          type: boolean
          example: false
          description: >-
            `true` when two devices at the location submit records for the same
            window or both declare that they meter the connection point. The
            last write wins and the OEM is notified.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate with the `bearer_token` obtained from the
        [authentication](/fleet-api/reference/authentication) endpoint.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.