IoT API Docs
Developer Docs
Connect hardware, gateways and services to GreenCircuit IoT over HTTPS.
https://greencircuit.co.za/wp-json/gciot/v1/ingest
Authentication
Each API key belongs to one device. Send it in the X-API-Key header. Keys are shown once, stored as keyed hashes, and can be rotated or revoked from API Keys.
Single reading
POST https://greencircuit.co.za/wp-json/gciot/v1/ingestContent-Type: application/json
X-API-Key: gcio_your_key
{
"ts": "2026-07-10T08:30:00Z",
"metrics": { "temperature": 22.5, "humidity": 61.2 },
"units": { "temperature": "C", "humidity": "%" },
"meta": { "firmware": "1.0.3", "rssi": -61 }
}
metrics is required and values must be numeric. Names are normalized to lowercase letters, numbers and underscores. Timestamp, units and metadata are optional.
Batch upload
Use one request to replay an offline buffer. Each item can have its own timestamp and units.
{
"readings": [
{ "ts": 1719900000, "metrics": { "temperature": 21.9 } },
{ "ts": 1719900600, "metrics": { "temperature": 22.4, "humidity": 61.2 } }
],
"meta": { "source": "offline_buffer" }
}Hardware and gateway examples
ESP32 / ArduinoUse HTTPClient and add the API key header before POSTing JSON.
Raspberry PiUse Python requests with a JSON body and X-API-Key header.
PLC / SCADAUse Node-RED or an edge gateway to map Modbus, S7 or OPC-UA tags to metrics.
Cloud servicesAny platform able to make an HTTPS POST can ingest numeric telemetry.
curl -X POST "https://greencircuit.co.za/wp-json/gciot/v1/ingest" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_KEY" \
-d '{"metrics":{"temperature":22.5},"units":{"temperature":"C"}}'Responses and limits
200Reading stored400Invalid payload401Missing, revoked or invalid key403Device paused429Rate limit; respect Retry-After5xxRetry with backoffCurrent beta limits: 20 metrics per reading, 100 readings per batch, and 10 seconds between requests per device.