Fleet API
Put your sites, devices and their data in Apex Fleet.
All requests go to https://prod-api.apexenergy.tech/api/external/v1. Bodies are JSON (Content-Type: application/json), names are camelCase, times are ISO 8601 with an offset.
Five steps
- Get a key from your organisation's admin in Fleet.
- Create a site:
POST /sites. Fleet adds the site's Site aggregate. - Register the site's devices:
POST /devices. - Send readings every minute:
POST /telemetry. - Open the site in Fleet.
curl https://prod-api.apexenergy.tech/api/external/v1/telemetry \
-H "Authorization: Bearer $FLEET_API_KEY" -H "Content-Type: application/json" \
-d '{"readings":[{"device":"PM5560-0042871","time":"2026-11-27T10:15:00Z",
"values":{"grid_power_w":3500,"grid_import_kwh":10234.5}}]}'
Keys
Send your key on every request:
Authorization: Bearer rfk_...
- An admin creates keys in Fleet: Organisations → your organisation → API keys.
- Fleet shows a key once. Store it in your secrets store.
- Keys expire within a year. A key revoked in Fleet stops at once.
GET/me any key
Response 200
{
"keyPrefix": "rfk_Ab12Cd34",
"organisationId": 258,
"permissions": ["fleet.create", "site.create", "site.edit", "site.view"]
}
Sites
POST/sites needs site.create, site.view
| Field | Type | Notes | |
|---|---|---|---|
name | string | required | 3 to 100 characters. |
address | string | required | Street address. |
latitude | number | required | -90 to 90. |
longitude | number | required | -180 to 180. |
currency | string | required | ZAR, NAD, BWP, ZWL, ZMW, AUD, CAD, USD, EUR or GBP. |
city, state, postalCode, country | string | optional | |
fleetIds | number[] | optional | Fleets to put the site in. Needs fleet.sites.manage. |
tagIds | number[] | optional | Your organisation's site tags. Needs tags.manage. |
{
"name": "Alberton Mall",
"address": "1 Main Road",
"city": "Alberton",
"country": "South Africa",
"latitude": -26.2678,
"longitude": 28.1219,
"currency": "ZAR",
"fleetIds": [310]
}
Response 201
{
"id": 5821,
"name": "Alberton Mall",
"organisationId": 258,
"siteType": "EXTERNAL",
"controller": "SITE-5821"
}
controller is the site's Site aggregate, which adds up its devices. See Site totals.
Devices
POST/devices needs site.edit
| Field | Type | Notes | |
|---|---|---|---|
identifier | string | required | The serial number, unique in Fleet. Up to 100 letters, digits and . - : /. |
name | string | required | What people see in Fleet. Up to 200 characters. |
type | string | required | Meter, Inverter, Solar, Battery, Genset, Grid, Switchgear, or your own. Not Controller. |
brand | string | required | The manufacturer. Known brands get their own picture. |
model | string | optional | Up to 200 characters. |
description | string | optional | Up to 250 characters. |
siteId | number | optional | Puts the device on this site straight away. |
aggregate | boolean | optional | Add the device to the site totals. Default true. See Site totals. |
{
"identifier": "PM5560-0042871",
"name": "Main incomer meter",
"type": "Meter",
"brand": "Schneider",
"model": "PM5560",
"siteId": 5821,
"aggregate": true
}
Response 201
{
"id": 90412,
"identifier": "PM5560-0042871",
"name": "Main incomer meter",
"type": "Meter",
"brand": "Schneider",
"organisationId": 258,
"siteId": 5821,
"imageUrl": "https://.../meter.png",
"aggregate": true,
"parentDevice": "SITE-5821"
}
Identifiers with _, Apex serials (M, E, H or V followed by digits, MCS…) and SITE- numbers are reserved.
Put devices on a site
POST/sites/{siteId}/devices needs site.edit
| Field | Type | Notes | |
|---|---|---|---|
deviceIds | number[] | required | Up to 100 of your devices. A device is on one site at a time. |
{ "deviceIds": [90412, 90413] }
Response 200
{ "siteId": 5821, "linked": [90413], "alreadyOnSite": [90412] }
Change a device
PATCH/devices/{deviceId} needs site.edit
| Field | Type | Notes | |
|---|---|---|---|
aggregate | boolean | required | Add the device to the site totals, or leave it out. |
{ "aggregate": false }
Response 200
{ "id": 90413, "identifier": "PM5560-0042872", "aggregate": false }
Device types
GET/device-types any key
{
"knownTypes": ["Meter", "Inverter", "Solar", "Battery", "Genset", "Grid", "Switchgear"],
"knownBrands": ["Huawei", "Schneider", "..."],
"pictures": [ { "brand": "Huawei", "type": "Inverter", "imageUrl": "https://..." } ]
}
Site totals
Fleet gives every API site a Site aggregate, SITE-{siteId}. It is the parent of the site's devices and adds them up by kind:
- All grid meters make the site's grid, all solar its solar, all batteries its battery, all generators its generator.
- Battery state of charge is the average.
- Without a load meter, the load is grid + solar + battery + generator.
Set "aggregate": false on a device that would count twice, such as a check meter or a sub-meter inside a main meter. Fleet still shows its own values and graphs. Editors can also change it in Fleet: the device's Update info.
The Site aggregate takes no readings. It is online while any device on the site is.
Fleets
POST/fleets needs fleet.create
| Field | Type | Notes | |
|---|---|---|---|
name | string | required | Up to 500 characters. |
description | string | optional | Up to 500 characters. |
siteIds | number[] | optional | Your sites to put in it. Needs fleet.sites.manage. |
{ "name": "Gauteng malls", "siteIds": [5821] }
Response 201
{ "id": 310, "name": "Gauteng malls", "organisationId": 258, "siteIds": [5821] }
POST/fleets/{fleetId}/sites needs fleet.sites.manage, site.view
{ "siteIds": [5821, 5822] }
Response 200
{ "fleetId": 310, "added": [5822], "alreadyInFleet": [5821] }
People
Each person has one role: Viewer, Editor or Admin.
GET/people/roles any key
[ { "name": "Editor", "description": "...",
"organisationRights": ["..."], "siteRights": ["..."], "fleetRights": ["..."] } ]
POST/people/invites needs org.members.manage
| Field | Type | Notes | |
|---|---|---|---|
email | string | required | |
role | string | required | Viewer, Editor or Admin. |
siteIds, fleetIds | number[] | optional | Up to 100 each. |
{ "email": "ops@example.com", "role": "Viewer", "siteIds": [5821] }
Response 201
{
"email": "ops@example.com", "role": "Viewer",
"addedNow": false, "userId": null,
"inviteId": 771, "expiresAt": "2026-12-04T10:15:00+00:00", "emailed": true
}
An existing Fleet user is added at once (addedNow: true). Anyone else gets an email.
GET/people needs org.members.view
{
"people": [ { "userId": 4410, "name": "Thandi M", "email": "thandi@example.com",
"role": "Editor", "siteIds": [5821], "fleetIds": [] } ],
"pendingInvites": [ { "inviteId": 771, "email": "ops@example.com",
"role": "Viewer", "expiresAt": "2026-12-04T10:15:00+00:00" } ]
}
PUT/people/{userId}/role needs org.members.manage
{ "role": "Admin" }
Returns the person, as in GET /people.
Send data
POST/telemetry needs site.edit
| Field | Type | Notes | |
|---|---|---|---|
readings | object[] | required | 1 to 1,000. |
readings[].device | string | required | The device's identifier. It must be on one of your sites. |
readings[].time | string | required | When it was measured, with offset. Up to 400 days old, at most 5 minutes ahead. |
readings[].values | object | required | 1 to 30 values, by name. |
{
"readings": [
{ "device": "PM5560-0042871", "time": "2026-11-27T10:15:00Z",
"values": { "grid_power_w": 3500, "grid_import_kwh": 10234.5, "grid_export_kwh": 88.1 } },
{ "device": "SUN2000-9921", "time": "2026-11-27T10:15:00+02:00",
"values": { "solar_power_w": 4200, "solar_energy_kwh": 5521.3 } }
]
}
Response 200
{ "accepted": 2, "devices": 2 }
- Send only what a device measures. A missing value is not zero.
- One bad reading rejects the request.
detaillists what to fix. - The same device and time replaces the old reading, so retries are safe.
- Send every 1 to 5 minutes.
Values
| Name | Unit | Range | Meaning |
|---|---|---|---|
grid_power_w | W | ±1,000,000,000 | Power from the grid: positive when importing, negative when exporting. |
grid_import_kwh | kWh | 0 or more | Grid meter's total imported energy. Meter reading. |
grid_export_kwh | kWh | 0 or more | Grid meter's total exported energy. Meter reading. |
solar_power_w | W | ±1,000,000,000 | Solar power produced. |
solar_energy_kwh | kWh | 0 or more | Total solar energy produced. Meter reading. |
battery_power_w | W | ±1,000,000,000 | Battery power: positive when discharging, negative when charging. |
battery_soc_pct | % | 0 to 100 | Battery state of charge. |
battery_charge_kwh | kWh | 0 or more | Total energy charged into the battery. Meter reading. |
battery_discharge_kwh | kWh | 0 or more | Total energy discharged from the battery. Meter reading. |
load_power_w | W | ±1,000,000,000 | Power the site's loads use. |
load_energy_kwh | kWh | 0 or more | Total energy the site's loads used. Meter reading. |
genset_power_w | W | ±1,000,000,000 | Generator power produced. |
genset_energy_kwh | kWh | 0 or more | Total generator energy produced. Meter reading. |
genset_fuel_pct | % | 0 to 100 | Generator fuel level. |
voltage_v | V | 0 to 1,000,000 | Voltage. |
current_a | A | ±1,000,000 | Current. |
frequency_hz | Hz | 0 to 1,000 | Frequency. |
temperature_c | °C | -100 to 1,000 | Temperature. |
grid_power_wis positive when importing.battery_power_wis positive when discharging.*_kwhvalues are meter readings: the running total, never the amount since the last reading. Fleet works out energy per hour, day and month from them.- GET/telemetry/fields returns this list as JSON:
name,unit,min,max,meaning,isMeterReading.
Events
POST/events needs site.edit
| Field | Type | Notes | |
|---|---|---|---|
events | object[] | required | 1 to 100. |
events[].device | string | required | A device on one of your sites, or the site's SITE- aggregate for site-wide events. |
events[].time | string | required | When it happened, with offset. |
events[].level | string | required | info, warning, error or critical. |
events[].message | string | required | Up to 500 characters. |
events[].active | boolean | optional | true keeps it open until you send the same device and message with false. |
{
"events": [
{ "device": "PM5560-0042871", "time": "2026-11-27T10:15:00Z",
"level": "error", "message": "Phase L2 lost", "active": true }
]
}
Response 200
{ "added": 1, "cleared": 0 }
Events show on the site's Events tab in Fleet.
Online and offline
A device is online while Fleet has a reading from it in the last 10 minutes. After 10 minutes without data it shows offline, and Fleet adds a warning event. Both clear when data arrives again.
All endpoints
| Request | Needs |
|---|---|
GET /me | – |
POST /sites | site.create, site.view |
GET /device-types | – |
POST /devices, POST /sites/{id}/devices, PATCH /devices/{id} | site.edit |
GET /telemetry/fields | – |
POST /telemetry, POST /events | site.edit |
POST /fleets | fleet.create |
POST /fleets/{id}/sites | fleet.sites.manage, site.view |
GET /people/roles | – |
POST /people/invites, PUT /people/{id}/role | org.members.manage |
GET /people | org.members.view |
A key that only sends data needs just site.edit ("Edit sites" in Fleet).
Errors and limits
Errors come back as Problem Details:
{
"title": "Invalid request",
"status": 400,
"detail": "No readings were stored: readings[0].values.grid_pwr is not a value Fleet knows (names are lower case, e.g. grid_power_w)."
}
| Status | Meaning |
|---|---|
| 400 | The request is wrong. detail says what to fix. |
| 401 | Missing, wrong, expired or revoked key. |
| 403 | The key lacks the permission. |
| 404 | Not found, or not in your organisation. |
| 409 / 422 | Conflict, or an Idempotency-Key reused for a different request. |
| 429 | Too many requests. Wait Retry-After seconds. |
| 503 | Nothing was stored. Retry after Retry-After. |
- Per key: 120 data requests, 120 reads and 30 other changes a minute.
- Per key per day: 500 sites, 1,000 devices, 100 fleets.
- Retry on network errors, 429 and 5xx, with backoff.
- When creating things, send an
Idempotency-Keyheader (a new UUID) so a retry can't create twice.
Changes
| Date | Change |
|---|---|
| 27 Nov 2026 | Each site gets a Site aggregate that adds up its devices. aggregate on devices, PATCH /devices/{id}. Devices can no longer be type Controller. |
| 27 Nov 2026 | Data, events, online and offline. |
| 26 Nov 2026 | Keys, sites, devices, fleets and people. |