Gateway API
External API gateway for the Hubble Network cloud platform. Receives BLE scan packets, gateway registrations, and debug logs from the crowdsourced BLE listening network.
Gateway management
This API is for gateway devices. To manage your organization's gateways, use the Cloud
API at https://api.hubble.com. The Cloud API lists gateways and gateway groups, and
creates, revokes and reactivates gateway groups.
Design Principles
- Queue-and-acknowledge: The packets, logs, and locations endpoints queue payloads and
return immediately (202). Deduplication is synchronous (per-device
batchIdcheck); anomaly detection and downstream processing happen asynchronously. - Idempotency: Every upload request includes a
batchId(UUID). Duplicate submissions within a 24-hour window (scoped per gateway) return the same 202 response without re-processing. - Additive evolution: New fields may be added to requests and responses without a
version bump. Clients MUST ignore unknown fields. Removing or renaming fields requires
/v2/. - Clock skew detection: All non-GET requests include
sentAtMillis(gateway clock at send time). The backend computes skew by comparing to its own receive time and can adjust client-supplied timestamps during processing.
Authentication
The API uses a two-phase authentication flow:
-
Device registration (first launch): The SDK sends a
PUT /api/v1/gatewaysrequest with the Gateway Group ID in theX-Sdk-Keyheader (a public, non-secret identifier for the gateway group). The server assigns agatewayIdand returns per-device credentials (deviceToken+refreshToken). -
Authenticated requests (ongoing): All subsequent requests use an
Authorization: Bearer {deviceToken}header. ThedeviceTokenis short-lived; when it expires, the SDK refreshes it viaPOST /api/v1/auth/refresh.
Rate Limiting
Every endpoint except the health and readiness probes is rate limited. When a limit is
exceeded the server returns 429 with error code rate_limited and retryable: true.
Back off as described under Retries.
Retries
Retry a failed request only when the error body has retryable: true, and back off
exponentially between attempts: no server response carries a Retry-After header or a
wait time, so the schedule is the client's. Start at no less than a few seconds, double
on each consecutive failure of the same request, add jitter so a fleet of devices does not
retry in lockstep, and cap the delay. A 429 and a retryable 503 are both answered this
way. When retrying an upload, resend it with the same batchId (see Idempotency).
Content Type
All request bodies MUST use Content-Type: application/json. A malformed or
non-JSON body is rejected with 400 invalid_payload — there is no separate
media-type error.
Compression
Requests MAY be sent with Content-Encoding: gzip. When present, the server
decompresses the request body before processing. Uncompressed requests are also accepted.
Batch Limits
| Endpoint | Max items | Max body (uncompressed) |
|---|---|---|
| Packets | 5000 | ~4 MB |
| Logs | 200 | ~1 MB |
| Locations | 500 | ~1 MB |
Exceeding the max item count for a batch is a 400 invalid_payload, not a
dedicated error code.
The server reads a packets request body within 60 seconds, and other
request bodies within 10 seconds. A packets body that times out gets a 503
with retryable: true. Send large packet batches with
Content-Encoding: gzip: 5000 packets are about 2.3 MB uncompressed.
Authentication
- API Key: SdkKeyAuth
- HTTP: Bearer Auth
Gateway Group ID. A public, non-secret identifier for the gateway group.
Used only during device registration (PUT /api/v1/gateways).
Security Scheme Type: | apiKey |
|---|---|
Header parameter name: | X-Sdk-Key |
Per-device Bearer token issued during device registration and refreshed
via POST /api/v1/auth/refresh.
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |