Retrieve a location
curl --request GET \
--url https://fleet-api.flatpeak.com/locations/{location_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://fleet-api.flatpeak.com/locations/{location_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://fleet-api.flatpeak.com/locations/{location_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://fleet-api.flatpeak.com/locations/{location_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://fleet-api.flatpeak.com/locations/{location_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://fleet-api.flatpeak.com/locations/{location_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://fleet-api.flatpeak.com/locations/{location_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}Locations
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.
GET
/
locations
/
{location_id}
Retrieve a location
curl --request GET \
--url https://fleet-api.flatpeak.com/locations/{location_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://fleet-api.flatpeak.com/locations/{location_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://fleet-api.flatpeak.com/locations/{location_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://fleet-api.flatpeak.com/locations/{location_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://fleet-api.flatpeak.com/locations/{location_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://fleet-api.flatpeak.com/locations/{location_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://fleet-api.flatpeak.com/locations/{location_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}Authorizations
Authenticate with the bearer_token obtained from the authentication endpoint.
Response
Location response.
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.
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.
Pattern:
^oem_[A-Za-z0-9]+$Example:
"oem_6a3a8dada72cd0a249ff9528"
Was this page helpful?

