Skip to the page
Docs menu

Docs API reference

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.

FieldDescription
idstringUnique identifier, prefixed msr_.
objectmeasurementString representing the object type. Always measurement.
livemodebooleantrue for objects in the live account, false for objects in the test account. Test and live data never mix.
item_idstringItem 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, nullableRaw short diameter in metres, 3 decimal places.
diameter_long_mnumber, nullableRaw long diameter in metres, 3 decimal places.
adjustmentsarray of AdjustmentAdjustments applied after measurement.
effective_short_mnumber, nullableShort diameter after adjustments, in metres.
effective_long_mnumber, nullableLong diameter after adjustments, in metres.
perimeterPerimeter, nullableA 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, nullableHow perimeter units convert to metres. The two factors differ when the tag is viewed at an angle.
scale.sourceqr_tag \| ar_raycast \| legacyqr_tag (the tag's printed size), ar_raycast (AR plane raycast) or legacy (measurements recorded before the platform, scale unknown).
scale.side_mmnumber, nullableQR tag side in mm when source is qr_tag.
scale.m_per_unit_xnumberMetres per perimeter unit along x.
scale.m_per_unit_ynumberMetres per perimeter unit along y.
qualityQuality, nullableConfidence and rejection-gate scores, where available.
quality.confidencenumber, nullableOverall confidence, 0 to 1.
quality.detection_confidencenumber, nullableDevice 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_gatesobjectScores 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.
provenanceProvenanceAudit record of how the measurement was produced. It is what an accuracy claim rests on in a dispute.
provenance.detectorModelRef, nullableA model and its version. Recorded on every measurement as id@version.
provenance.segmenterModelRef, nullableA model and its version. Recorded on every measurement as id@version.
provenance.sdk_versionstring, nullableSDK name and version.
provenance.app_versionstring, nullableHost app version.
provenance.device_modelstring, nullableDevice model.
provenance.osstring, nullableOperating system and version.
provenance.actorobjectWho or what created the measurement.
provenance.simulatedbooleantrue 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, nullableRequired explanation for manual_override; null for other stages.
image_idstring, nullableItem image the measurement was taken from.
scan_idstring, nullableScan it belongs to.
created_atstringCreation time.
tag_cornersTagCorners, nullableEvidence from a capture client; null when it sent none.
diameter_linesDiameterLines, nullableThe 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, nullableThe log's box in its crop, from a capture client; null when it sent none.
measured_rect.xnumberLeft edge, 0 to 1 as a fraction of image width.
measured_rect.ynumberTop edge, 0 to 1 as a fraction of image height.
measured_rect.widthnumberBox width as a fraction of image width.
measured_rect.heightnumberBox 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

FieldDescription
id requiredstring, pathItem id.
limitinteger, queryPage size, 1 to 100.
starting_afterstring, queryOpaque cursor: pass the next_cursor of the previous page. Results are ordered by (created_at, id).
expand[]array of string, queryReplace an id field with the full object, e.g. expand[]=origin_place. Allowed values are listed on each resource.

Request

TypeScript
for await (const measurement of timbereye.items.listMeasurements("itm_5Lw2Nc")) {
    // every page, one at a time
}
curl
curl https://api.timbereye.com/v1/items/itm_5Lw2Nc/measurements \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"
CLI
timbereye items measurements list itm_5Lw2Nc --json

Response

JSON
// 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
StatusWhen
400invalid_request_error: the request was malformed or a field was invalid.
401authentication_error: missing, malformed, expired or revoked key.
403permission_error: the key lacks the scope, the capture token is limited to other groups, or the resource is read-only to you.
404invalid_request_error, resource_missing: no such object. Objects in another account are also reported as 404.
429rate_limit_error: slow down and retry after the Retry-After delay.
500api_error: something went wrong on our side. Safe to retry with the same Idempotency-Key.
503api_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

FieldDescription
id requiredstring, pathItem id.

Body

FieldDescription
diameter_short_m requirednumberShort diameter in metres.
diameter_long_m requirednumberLong diameter in metres.
reason requiredstringWhy the value is being overridden. Required, because overrides take precedence over refined values and are audited.
image_idstringThe image the override was measured from, if any: the log-end photo it is based on.

Request

TypeScript
const result = await timbereye.items.createMeasurement("itm_5Lw2Nc", {
    diameterShortM: 0.47,
    diameterLongM: 0.488,
    reason: "Caliper check on the mill deck",
})
curl
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"
  }'
CLI
timbereye items measurements create itm_5Lw2Nc \
  --reason 'Caliper check on the mill deck' \
  --data '{"diameter_short_m":0.47,"diameter_long_m":0.488}' \
  --json

Response

JSON
// 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
StatusWhen
400invalid_request_error: the request was malformed or a field was invalid.
401authentication_error: missing, malformed, expired or revoked key.
403permission_error: the key lacks the scope, the capture token is limited to other groups, or the resource is read-only to you.
404invalid_request_error, resource_missing: no such object. Objects in another account are also reported as 404.
409invalid_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.
413invalid_request_error, payload_too_large: the upload is over the size limit (10 MB for multipart).
422invalid_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.
429rate_limit_error: slow down and retry after the Retry-After delay.
500api_error: something went wrong on our side. Safe to retry with the same Idempotency-Key.
503api_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.