Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cula.tech/llms.txt

Use this file to discover all available pages before exploring further.

Use Amount for data points that pair a number with a unit:
{ "value": 500, "unit": "kg" }
You see this shape when a data point config has type: "amount", such as incoming biomass weight, output volume, or energy use.

Amount bases and units

For amount data point configs, amount_base defines the accepted units. You can submit any unit listed for that base across metric, imperial, and US customary systems.
amount_baseAccepted unit valuesDescription
weightkg, t, lbs, shorttonMass measurements
volumel, m3, foot^3, yard^3Volume measurements
temperaturecelsiusTemperature readings
watt_hourskWhEnergy measurements
The unit must belong to the configured amount_base. For example, sending "unit": "l" for a data point with amount_base: "weight" returns a validation error.

Submit the unit you have

You do not need to convert values to the site’s unit system before writing them. For a weight data point, all of these values are valid:
Valid weight amounts
[
  { "value": 500, "unit": "kg" },
  { "value": 0.5, "unit": "t" },
  { "value": 1102.31, "unit": "lbs" },
  { "value": 0.551, "unit": "shortton" }
]
The API stores the submitted value and unit, then converts internally for calculations and display.

Validation

Amount values are checked against these rules:
  1. Unit must match the base. The submitted unit must belong to the data point’s amount_base (see table above).
  2. Value must be a finite number. Non-finite values (NaN, Infinity) are rejected.
  3. Range bounds are optional. A data point config can declare min and/or max Amount bounds. If present, the submitted value is checked against those thresholds.
Example config with validation bounds
{
  "id": "dpc_01abc...",
  "name": "Weight gross",
  "type": "amount",
  "amount_base": "weight",
  "accepts_input": true,
  "is_mandatory": true,
  "validation": {
    "min": { "value": 0, "unit": "kg" },
    "max": { "value": 100000, "unit": "kg" }
  }
}

Discovering valid units from configs

Read the config version and inspect amount_base on each type: "amount" data point config:
curl https://api.cula.tech/tracking/v1/delivery-configs/dlc_01kqzcjrpxf27tge33jwvjhkff/versions/active \
  -H "Authorization: Bearer $CULA_ACCESS_TOKEN" \
  -H "Cula-Org-Id: $CULA_ORG_ID"
Because amount_base is weight, this data point accepts kg, t, lbs, or shortton. Submit the unit your system produces.
For a full walkthrough of reading configs and creating runtime resources, see Runtime and config layer.