Correct a data point value
Substitutes the value of one data point, addressed by its data point type slug within an event. Use it to replace a wrong reading, or to set a value where none was recorded. The server records the previous value as from_value, which is null when no reading existed, and creates the data point on the event if it did not exist yet.
Each call appends to the data point’s correction history, so the original reading stays readable.
Setting a value does not recalculate anything downstream. A batch that was already generated keeps the value it was generated with.
Replays return 200, new corrections return 201. A call is treated as a replay when the data point’s latest correction has both the same method and the same value, in which case that existing correction is returned and nothing is written. Values are compared after normalization, so "10.2", 10.2 and a stored 10.20 all match. Note that method participates in this check: retrying with a different method writes a second correction rather than matching the first.
Requires corrections to be enabled on the account.
Authorizations
Path Parameters
Unique ID of the event in the evt_XXXX syntax. For example: evt_DLnYvzbjSujNAvXE
Data point type slug on the event's event type. For example: ambient-temperature-c. A slug the event type does not define returns 422.
Body
The corrected value. Number, string or boolean, matching the data point type. Required; a null value returns 400.
How the value was arrived at, recorded on the correction and shown in the audit trail. Free text, and it also decides whether a repeat call is treated as a replay.
Free-text justification stored with the correction.
Optional guard on the state you believe the data point is in. Pass gap to require that it is currently empty, or existing to require that it already has a value. A mismatch returns 422 and writes nothing. Because this endpoint creates the data point when the slug has no value yet, existing is the guard that stops a wrong slug or event ID from silently manufacturing data. It only tests empty against non-empty, so it will not detect a value that changed from one number to another.
gap, existing Response
Replay of the latest correction; nothing was written.
One entry in a data point's correction history.
Correction friendly ID.
"sub_9TnpQxL2mKdRvWs4"
Friendly ID of the corrected data point.
"in_kiIuaGIUqRxWUmTY"
ingestion corrections change the data point's value, which every model and report reads. Corrections written through this API are always ingestion. value_stream corrections are overrides scoped to a single value stream and leave the shared value untouched; they cannot be created here.
ingestion, value_stream Where the correction came from. Corrections written through this API are api.
manual, api, rule, transformation How the value was arrived at, as supplied by the caller. Reverts are recorded with the reserved method revert.
"manual_entry"
substituted changed an existing reading. imputed set a value where none was recorded, and is the case the Events table calls Value was missing. reverted restored the previous value.
substituted, imputed, reverted The value before this entry. Null when no reading existed.
The value after this entry.
The data rule that wrote this correction. Null for manual and API corrections.
Name of the user the correction is attributed to.