Zum Hauptinhalt springen

Add a device to your Reeftank

The Reef Assistant Public API is designed to enable external devices and tech-savvy users to seamlessly add data to the Reef Assistant logbook. This allows for easy integration of additional device data, such as readings from the Reefbot Lab or similar equipment.


🔗 Endpoint

POST https://reefassistant.io/api/public/logbook/add

🔐 Authentication

Authentication is based on a personal access token linked to a specific reef tank.

"auth": {
"tank_id": "UUID",
"token": "TOKEN"
}
FieldTypeDescription
tank_idUUIDThe reef tank's unique identifier
tokenStringPersonal access token for the user

📦 Request Body (JSON)

{
"auth": {
"tank_id": "4ba3fe75-169c-4a1a-91d0-2f9ecd3b2fcf",
"token": "1152|abc123..."
},
"data": {
"element": "alk",
"value": 8.5,
"unit": "dkh",
"added_at": "28.07.2025 11:15",
"timezone": "Europe/Berlin"
},
"device": {
"device_name": "Public API",
"device_manufacturer": "fynix GmbH",
"device_model": "pub_api",
"device_hardware_version": "1.0.0",
"device_software_version": "1.0.1"
}
}

🧪 Field Descriptions

🔹 data

FieldTypeRequiredDescription
elementStringElement name (e.g. alk, po4, ca, ...)
valueFloatMeasured value
unitStringMeasurement unit (must match matrix definition)
added_atStringTimestamp when the value was measured
timezoneStringTimezone (e.g. Europe/Berlin, UTC)

🔹 device (optional)

FieldTypeDescription
device_nameStringDevice name
device_manufacturerStringManufacturer
device_modelStringModel name
device_hardware_versionStringHardware version
device_software_versionStringSoftware version

✅ Success Response

{
"message": "success, record created.",
"entry_id": 1234
}

⚠️ Error Responses

StatusMeaning
400Invalid data or outside matrix range
401Invalid or expired token
403Access denied for given tank
404Tank or matrix not found

🌡️ Supported Elements

alk, salinity, ph, po4, no3, ca, mg, temp,
b, br, cl, k, na, sr, so4, s, sac254,
ba, cr, co, fe, f, i, cu, li, mn, mo,
ni, se, v, zn, sn, cs, no2, p, po4s, si

⚙️ Supported Units

CodeDisplay Value
mlml
mg_lmg/L
ug_lµg/L
dkh°dKH
mol_lmol/L
celsius°C
psuPSU
gg
m-1m-1
g_cm3Dichte g/cm³
ms_cmmS/cm
meq_lmEq/L
ppmppm
p_ug_lPhosphor µg/L
mum-u

📚 Example: cURL Request

curl -X POST https://reefassistant.io/api/public/logbook/add \
-H "Content-Type: application/json" \
-d '{
"auth": {
"tank_id": "abc-def-uuid",
"token": "1152|abc..."
},
"data": {
"element": "alk",
"value": 7.3,
"unit": "dkh",
"added_at": "28.07.2025 11:15",
"timezone": "Europe/Berlin"
},
"device": {
"device_name": "ReefBot",
"device_manufacturer": "ReefCorp",
"device_model": "RB-X1",
"device_hardware_version": "2.0.1",
"device_software_version": "5.4.3"
}
}'

💡 Notes

  • The timestamp (added_at) is parsed in the provided timezone and converted to UTC internally.
  • Values outside of the configured min/max range (per element in your tank matrix) will be rejected.
  • Units must match the matrix definition for the selected element.

✉️ Questions? Contact us at support@reefassistant.io