Forwarding Scans From Your Cloud
Forward your gateways' BLE scans from your backend to Hubble.
This is one of three ways to become a Hubble scanner. If you have not chosen one yet, start with Becoming a Hubble Scanner.
Who This Is For
Use a cloud-to-cloud integration when your gateways can only talk to your own backend, or when you already have a scanning and ingestion pipeline from your gateways to your backend:
[Your gateways] --> [Your backend] --> [Hubble ingest endpoint]
Your backend calls one endpoint, POST /api/ble/{org_id}/ingest, with your organization's API token. There is no scanner registration, no per-device credentials, and no heartbeats. Hubble sees the observations as coming from your organization, not from individual scanners.
If your gateways can reach Hubble themselves, the Gateway SDK or a direct integration gives Hubble a per-scanner identity, health reporting, and server-side configuration.
Before You Start
Check What Your Gateways Report
Your gateways must send your backend everything Hubble needs. For each advertisement, that is:
- The Hubble service data bytes, exactly as received, not a parsed or decoded summary. See Extracting the Payload.
- The RSSI the radio measured
- The time the gateway received it
- A location fix for the gateway at that time: latitude, longitude, and altitude
If your existing pipeline drops service data or does not carry location, you cannot recover that in the cloud. Extend what your gateways report before you build the forwarding side.
What You Need
- A Hubble account. Create one at dash.hubble.com if you don't have one.
- Your Organization ID.
- An API token for your organization, created in the dashboard under Developer Tools: API Tokens. See Users and Roles for who can create one.
You do not need a Gateway Group ID for this path.
Send Scans
Send scans with POST /api/ble/{org_id}/ingest on https://api.hubble.com. The full request schema is in Request Body below.
curl -X POST "https://api.hubble.com/api/ble/$ORG_ID/ingest" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d @scans.json
Request Body
The body is a list of ble_locations. Each entry pairs one location fix with the advertisements heard there:
{
"ble_locations": [
{
"location": {
"latitude": 47.62051,
"longitude": -122.34931,
"altitude": 56.0,
"horizontal_accuracy": 10.0,
"vertical_accuracy": 15.0,
"timestamp": 1795050000.0
},
"adv": [
{ "payload": "<base64 service data>", "rssi": -71, "timestamp": 1795050003.25 },
{ "payload": "<base64 service data>", "rssi": -84, "timestamp": 1795050004.10 }
]
}
]
}
| Field | What to send |
|---|---|
location.latitude, location.longitude | WGS 84 decimal degrees. Required. |
location.altitude | Altitude in meters. Required. |
location.horizontal_accuracy, location.vertical_accuracy | Accuracy in meters. Optional, but send them when you have them. |
location.timestamp | When the location fix was taken, in Unix epoch seconds. Required. |
adv | One advertisement object, or a list of them, heard at that location. |
adv.payload | The Hubble service data, base64-encoded: the bytes that follow the AD type (0x16) and the UUID 0xFCA6 in the Service Data AD structure, as in the Gateway API's serviceData. Required. |
adv.rssi | Received signal strength in dBm, as the gateway's radio measured it. Required. |
adv.timestamp | When the gateway received the advertisement, in Unix epoch seconds. Fractions of a second are allowed. Required. |
All timestamps are UTC, in seconds rather than milliseconds.
Guidance
Forward Only Hubble Advertisements
Filter before you forward. An advertisement is a Hubble packet if it contains non-empty Service Data for the Hubble Service UUID 0xFCA6. See Identifying a Hubble Advertisement.
Treat the service data as an opaque byte array. Do not parse, decrypt, interpret, or change it. Forward it exactly as the gateway received it.
Timestamps
Use the time the gateway received the advertisement, not the time your backend processed it. Keep your gateways' clocks synced to a reliable source, such as NTP, GPS, or cellular network time.
Location
- Use the gateway's location, not your backend's. Each entry's
locationmust be where the gateway was when it heard the advertisements. - Reuse the last fix, with its real timestamp. If fixes are intermittent, attach the most recent one and report when it was taken.
- Never send
0, 0or other placeholder coordinates. Leave out advertisements you have no location for. - Fixed installs: use the surveyed position and a realistic accuracy.
Proof of presence is only as good as the scanner's location, so make it as accurate as you can.
Deduplication and Batching
A Hubble device can repeat the same advertisement many times a second. Before you forward, merge repeated sightings of the same advertisement from the same device within a short window, and keep the strongest RSSI.
Group advertisements that share a location fix into one ble_locations entry, and send several entries per request rather than one request per advertisement.
Errors and Retries
| HTTP | What to do |
|---|---|
| 200 | The data was accepted. |
| 400 | The request is malformed. Do not resend it unchanged. Log the response's description and fix the request. |
| 401 | The API token is missing, wrong, or revoked. Stop and alert an operator. |
| 429 | Back off, then retry. |
| 500 | Back off, then retry. |
Back off exponentially, cap the delay (five minutes is a reasonable ceiling), and add random jitter so retries do not arrive in lockstep. The endpoint has no batch ID, so a retry of a request that was in fact accepted can send the same advertisements again. Deduplicating before you send keeps this to a minimum.
Every response includes an X-Request-ID header. Include it when you contact Hubble support about a request.
Security
- Send all traffic over HTTPS.
- The API token authenticates as your organization. Keep it in your backend's secret store. Never put it on gateways, in client apps, or in logs.
- You are responsible for securing the link between your gateways and your backend.
Checklist
- Gateways report Hubble service data, RSSI, receive time, and location with altitude
- API token stored in your backend's secret store, never on gateways
- Only advertisements with
0xFCA6Service Data are forwarded -
0xFCA6service data forwarded unchanged, base64-encoded - Timestamps are the gateway's receive time, in epoch seconds
- Each entry's location is the gateway's own, with no
0, 0placeholders - Sightings deduplicated, keeping the strongest RSSI
- Retries on
429and500with exponential backoff, jitter, and a cap
ℹ️ Was this page useful? Please give us feedback.