Skip to the page
Docs menu

Docs API reference

Volume

Rules and computed volume.

The volume object#

Volume of a group or an item under a rule. Items without any measurement do not count toward items.

FieldDescription
objectvolumeString representing the object type. Always volume.
livemodebooleantrue for objects in the live account, false for objects in the test account. Test and live data never mix.
rulestringRule applied.
rule_versionstringRule version.
m3numberVolume in cubic metres.
nativeobject, nullableVolume in the rule's own unit. An object exactly when the rule's output_unit is not m3 (board-foot rules); null for cubic-metre rules such as jas. Always present.
native.valuenumberValue.
native.unitstringUnit, e.g. board_feet.
itemsintegerMeasured items counted (see measured in the group summary). m3 also includes the nominal volume of assigned items, which are not counted here.
refinedintegerItems counted whose server refinement has succeeded.
estimated_onlyintegeritems minus refined: items counted from a device estimate or a manual override only.
density_kg_m3number, nullableNet weight over volume, groups only.

Volume of a group#

GET/v1/groups/{id}/volume

Computes the group's volume under a rule on read, including child groups.

Keys: secret key; restricted key with groups:read.

Parameters

FieldDescription
id requiredstring, pathGroup id.
rulestring, queryVolume rule id, one of the id values listed by GET /volume_rules (v1: jas). Defaults to the account's default rule. An unknown id is a 400 parameter_invalid with param: rule.

Request

TypeScript
const result = await timbereye.groups.volume("grp_7QxV3m")
curl
curl https://api.timbereye.com/v1/groups/grp_7QxV3m/volume \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"
CLI
timbereye groups volume grp_7QxV3m --json

Response

JSON
// 200
{
  "object": "volume",
  "livemode": true,
  "rule": "jas",
  "rule_version": "1",
  "m3": 21.384,
  "native": null,
  "items": 142,
  "refined": 139,
  "estimated_only": 3
}
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.

Volume of an item#

GET/v1/items/{id}/volume

Computes one item's volume under a rule.

Keys: secret key; restricted key with items:read.

Parameters

FieldDescription
id requiredstring, pathItem id.
rulestring, queryVolume rule id, one of the id values listed by GET /volume_rules (v1: jas). Defaults to the account's default rule. An unknown id is a 400 parameter_invalid with param: rule.

Request

TypeScript
const result = await timbereye.items.volume("itm_5Lw2Nc")
curl
curl https://api.timbereye.com/v1/items/itm_5Lw2Nc/volume \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"
CLI
timbereye items volume itm_5Lw2Nc --json

Response

JSON
// 200
{
  "object": "volume",
  "livemode": true,
  "rule": "jas",
  "rule_version": "1",
  "m3": 21.384,
  "native": null,
  "items": 142,
  "refined": 139,
  "estimated_only": 3
}
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.

List volume rules#

GET/v1/volume_rules

Returns every rule available to compute volume, in one page: the list is not paginated, so has_more is always false and next_cursor null, and the endpoint takes no limit or starting_after. Rules are pure functions, mirrored by an open-source library with test vectors.

Keys: secret key; restricted key with groups:read; capture token (Allowed); publishable key (Allowed).

Request

A phone does not call this itself: the Swift and Kotlin SDKs make this call for the scanner, with the app's key. See Scan in your app. The samples are for your server.

TypeScript
const page = await timbereye.volumeRules.list()
curl
curl https://api.timbereye.com/v1/volume_rules \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"
CLI
timbereye volume-rules list --json

Response

JSON
// 200
{
  "object": "list",
  "data": [
    {
      "id": "jas",
      "object": "volume_rule",
      "name": "JAS",
      "version": "1",
      "description": "Japanese Agricultural Standard log volume from the short diameter and the length.",
      "output_unit": "m3"
    }
  ],
  "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.