Measurements
Versioned diameters.
The measurement object#
One versioned measurement of an item. Measurements are immutable; a new one is added instead of editing. The newest measurement of the highest-precedence stage is the item's effective measurement.
| Field | Description |
|---|---|
idstring | Unique identifier, prefixed msr_. |
objectmeasurement | String representing the object type. Always measurement. |
livemodeboolean | true for objects in the live account, false for objects in the test account. Test and live data never mix. |
item_idstring | Item measured. |
stageenum (device_estimate, server_refined, assigned, manual_override) | Where in the pipeline the measurement came from. Precedence when choosing the effective one: manual_override over server_refined over device_estimate over assigned. assigned is a bulk diameter class with no image. |
methodenum (qr_scale, ar_scale, assigned, manual) | qr_scale: scaled from a QR tag. ar_scale: scaled with an AR plane raycast (no tag). assigned: a nominal class. manual: a person entered it. |
diameter_short_mnumber, nullable | Raw short diameter in metres, 3 decimal places. |
diameter_long_mnumber, nullable | Raw long diameter in metres, 3 decimal places. |
adjustmentsarray of Adjustment | Adjustments applied after measurement. |
effective_short_mnumber, nullable | Short diameter after adjustments, in metres. |
effective_long_mnumber, nullable | Long diameter after adjustments, in metres. |
perimeterPerimeter, nullable | A normalised polygon outlining the log end: at least 3 [x, y] points. A server-refined perimeter has exactly 50 points; a device may send any number from 3 up, which is stored and returned as sent. A server-refined measurement's diameters are measured across it. |
scaleScale, nullable | How perimeter units convert to metres. The two factors differ when the tag is viewed at an angle. |
scale.sourceqr_tag \| ar_raycast \| legacy | qr_tag (the tag's printed size), ar_raycast (AR plane raycast) or legacy (measurements recorded before the platform, scale unknown). |
scale.side_mmnumber, nullable | QR tag side in mm when source is qr_tag. |
scale.m_per_unit_xnumber | Metres per perimeter unit along x. |
scale.m_per_unit_ynumber | Metres per perimeter unit along y. |
qualityQuality, nullable | Confidence and rejection-gate scores, where available. |
quality.confidencenumber, nullable | Overall confidence, 0 to 1. |
quality.detection_confidencenumber, nullable | Device estimates: The log detector's own score, 0 to 1, for the box the phone measured the log in (the centre-log box of its last detection before measuring). How sure the detector was that the box is a log end: use it to rank logs or flag low ones for a look. It is not an accuracy of the diameters, not the probability that the measurement is right, and not comparable across detector versions (provenance.detector). Null when the phone sent none (counted tags, logs from app builds that did not send it, other clients). |
quality.rejection_gatesobject | Scores from the capture quality gates, keyed by gate name. The keys below are the ones the SDK engines emit (all optional); other keys are allowed and kept. Values are numbers; a flag is 1 or 0. |
provenanceProvenance | Audit record of how the measurement was produced. It is what an accuracy claim rests on in a dispute. |
provenance.detectorModelRef, nullable | A model and its version. Recorded on every measurement as id@version. |
provenance.segmenterModelRef, nullable | A model and its version. Recorded on every measurement as id@version. |
provenance.sdk_versionstring, nullable | SDK name and version. |
provenance.app_versionstring, nullable | Host app version. |
provenance.device_modelstring, nullable | Device model. |
provenance.osstring, nullable | Operating system and version. |
provenance.actorobject | Who or what created the measurement. |
provenance.simulatedboolean | true when the measurement was produced by the test-mode simulator (see POST /test/scans/simulate) instead of a device or the segmentation service. Simulated measurements exist only in test mode and are never billed. |
provenance.diameter_sourceenum (segmentation_outline, device, simulator, assigned, manual) | What the diameters were measured from: segmentation_outline, across the outline the segmentation model traced on the server (live, and test mode for a real photo); device, the phone's own measurement (its detector with the tag or AR scale), which stands while the outline is pending or when it failed; simulator, test mode's simulator (practice values, only for scans a developer simulated); assigned, the group spec's nominal class; manual, entered by a person. |
reasonstring, nullable | Required explanation for manual_override; null for other stages. |
image_idstring, nullable | Item image the measurement was taken from. |
scan_idstring, nullable | Scan it belongs to. |
created_atstring | Creation time. |
tag_cornersTagCorners, nullable | Evidence from a capture client; null when it sent none. |
diameter_linesDiameterLines, nullable | The two lines the short and the long diameter were measured along, normalised to the measurement's photo: what the capture client sent, or, for a server-refined measurement, the lines the segmentation's diameters were taken between (stored with it, not recomputed). Null when neither exists. |
measured_rectNormalizedBox, nullable | The log's box in its crop, from a capture client; null when it sent none. |
measured_rect.xnumber | Left edge, 0 to 1 as a fraction of image width. |
measured_rect.ynumber | Top edge, 0 to 1 as a fraction of image height. |
measured_rect.widthnumber | Box width as a fraction of image width. |
measured_rect.heightnumber | Box height as a fraction of image height. |
List an item's measurements#
GET/v1/items/{id}/measurements
Returns the item's full measurement history, newest first.
Keys: secret key; restricted key with items:read.
Parameters
| Field | Description |
|---|---|
id requiredstring, path | Item id. |
limitinteger, query | Page size, 1 to 100. |
starting_afterstring, query | Opaque cursor: pass the next_cursor of the previous page. Results are ordered by (created_at, id). |
expand[]array of string, query | Replace an id field with the full object, e.g. expand[]=origin_place. Allowed values are listed on each resource. |
Request
for await (const measurement of timbereye.items.listMeasurements("itm_5Lw2Nc")) {
// every page, one at a time
}curl https://api.timbereye.com/v1/items/itm_5Lw2Nc/measurements \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"timbereye items measurements list itm_5Lw2Nc --jsonResponse
// 200
{
"object": "list",
"data": [
{
"id": "msr_8Rt4Vb",
"object": "measurement",
"livemode": true,
"item_id": "itm_5Lw2Nc",
"stage": "server_refined",
"method": "qr_scale",
"diameter_short_m": 0.477,
"diameter_long_m": 0.492,
"adjustments": [],
"effective_short_m": 0.477,
"effective_long_m": 0.492,
"perimeter": [
[0.21, 0.5],
[0.5, 0.2],
[0.8, 0.5],
[0.5, 0.81]
],
"scale": {
"source": "qr_tag",
"side_mm": 62,
"m_per_unit_x": 0.81,
"m_per_unit_y": 0.8
},
"quality": { "confidence": 0.94, "rejection_gates": {} },
"provenance": {
"detector": {
"id": "log-detector",
"version": "2.1.0"
},
"segmenter": {
"id": "log-segmenter",
"version": "1.3.0"
},
"sdk_version": "timbereye-ios 1.4.0",
"app_version": "3.2.1",
"device_model": "iPhone15,3",
"os": "iOS 18.2",
"actor": { "type": "system", "id": null }
},
"reason": null,
"image_id": "img_K3s9",
"scan_id": "scn_9a2Lk",
"created_at": "2027-02-03T14:40:52Z"
}
],
"has_more": false,
"next_cursor": null
}Errors
| Status | When |
|---|---|
400 | invalid_request_error: the request was malformed or a field was invalid. |
401 | authentication_error: missing, malformed, expired or revoked key. |
403 | permission_error: the key lacks the scope, the capture token is limited to other groups, or the resource is read-only to you. |
404 | invalid_request_error, resource_missing: no such object. Objects in another account are also reported as 404. |
429 | rate_limit_error: slow down and retry after the Retry-After delay. |
500 | api_error: something went wrong on our side. Safe to retry with the same Idempotency-Key. |
503 | api_error: isolation_unavailable (the resource's account isolation is not in place), service_unavailable (for example image storage not available in this environment) or model_unavailable (no on-device detector to offer in this environment). Retry later. |
Override a measurement#
POST/v1/items/{id}/measurements
Adds a manual_override measurement, which becomes the effective one. A reason is required and recorded with your key as the actor.
Keys: secret key; restricted key with items:write.
Parameters
| Field | Description |
|---|---|
id requiredstring, path | Item id. |
Body
| Field | Description |
|---|---|
diameter_short_m requirednumber | Short diameter in metres. |
diameter_long_m requirednumber | Long diameter in metres. |
reason requiredstring | Why the value is being overridden. Required, because overrides take precedence over refined values and are audited. |
image_idstring | The image the override was measured from, if any: the log-end photo it is based on. |
Request
const result = await timbereye.items.createMeasurement("itm_5Lw2Nc", {
diameterShortM: 0.47,
diameterLongM: 0.488,
reason: "Caliper check on the mill deck",
})curl -X POST https://api.timbereye.com/v1/items/itm_5Lw2Nc/measurements \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"diameter_short_m": 0.47,
"diameter_long_m": 0.488,
"reason": "Caliper check on the mill deck"
}'timbereye items measurements create itm_5Lw2Nc \
--reason 'Caliper check on the mill deck' \
--data '{"diameter_short_m":0.47,"diameter_long_m":0.488}' \
--jsonResponse
// 200
{
"id": "msr_3Jd6Qp",
"object": "measurement",
"livemode": true,
"item_id": "itm_5Lw2Nc",
"stage": "manual_override",
"method": "manual",
"diameter_short_m": 0.47,
"diameter_long_m": 0.488,
"adjustments": [],
"effective_short_m": 0.47,
"effective_long_m": 0.488,
"perimeter": null,
"scale": null,
"quality": null,
"provenance": {
"detector": null,
"segmenter": null,
"sdk_version": null,
"app_version": null,
"device_model": null,
"os": null,
"actor": { "type": "key", "id": null }
},
"reason": "Caliper check on the mill deck",
"image_id": null,
"scan_id": null,
"created_at": "2027-02-04T09:15:00Z"
}Errors
| Status | When |
|---|---|
400 | invalid_request_error: the request was malformed or a field was invalid. |
401 | authentication_error: missing, malformed, expired or revoked key. |
403 | permission_error: the key lacks the scope, the capture token is limited to other groups, or the resource is read-only to you. |
404 | invalid_request_error, resource_missing: no such object. Objects in another account are also reported as 404. |
409 | invalid_request_error: idempotency_key_reused, idempotency_request_in_progress, group_not_empty, group_billed, place_in_use, resource_exists, place_name_taken or another state conflict. |
413 | invalid_request_error, payload_too_large: the upload is over the size limit (10 MB for multipart). |
422 | invalid_request_error: the request was well formed but cannot be applied. Codes: group_cycle, group_depth_exceeded, unit_ambiguous, weight_inconsistent, area_ha_not_allowed, assignment_required. |
429 | rate_limit_error: slow down and retry after the Retry-After delay. |
500 | api_error: something went wrong on our side. Safe to retry with the same Idempotency-Key. |
503 | api_error: isolation_unavailable (the resource's account isolation is not in place), service_unavailable (for example image storage not available in this environment) or model_unavailable (no on-device detector to offer in this environment). Retry later. |