Scans
The record of one sitting of capture.
The scan object#
One capture session: a method, a device, a model and a place. Fields you can request through expand[]: group.
| Field | Description |
|---|---|
idstring | Unique identifier, prefixed scn_. |
objectscan | String representing the object type. Always scan. |
livemodeboolean | true for objects in the live account, false for objects in the test account. Test and live data never mix. |
client_idstring, nullable | Caller-chosen identifier, unique per account and resource type. The SDKs set it so records created offline reconcile when they sync. Posting a scan again with the same client_id returns the existing scan (200) when its method, intent, group_id and replaces_scan_id equal the stored ones, and is 409 client_id_conflict when one differs; GET /scans?client_id= finds it. |
methodenum (qr_scale, ar_scale, qr_count, photo_count) | Capture method. qr_scale: measure logs scaled by a QR tag. ar_scale: measure untagged logs with AR scale. qr_count: count QR-tagged logs and reconcile against the group. photo_count: count logs in one or more group images of a group. Server-side counting is not available in the current build: the count is the number of detections the client supplied on the scan's group images (detections on POST /images; the multipart upload carries none), and the status ends at estimated. scan.refined is never sent for a photo_count scan. |
intentenum (add, remove, verify), nullable | What a qr_count scan does against the group. add creates items for unknown tags, with an assigned measurement from the group's spec, and moves items of known tags in from other groups (not with a publishable key: 409 item_move_not_allowed); remove takes matched items out of the group; verify only reports, including the group's items that were not seen. A publishable key may use add only. |
group_idstring, nullable | Group the scan targets. |
statusenum (open, processing, estimated, refined, failed) | open: accepting items and images. processing: submitted. estimated: every item has a device estimate stored. refined: every item is server_refined or has a recorded refinement failure. failed: the scan could not be processed. A photo_count scan ends at estimated: its count is the client's detections, and nothing refines it. A qr_count scan never refines: submitting it sets refined directly (it passes through neither processing nor estimated), and scan.refined is sent. |
deviceScanDevice, nullable | Device that took the scan. |
device.platformstring | e.g. ios. |
device.modelstring | Device model. |
device.osstring | OS version. |
device.app_versionstring | Host app version. |
sdkScanSdk, nullable | SDK that produced the scan. Scans created through the legacy GraphQL path report legacy-ios. |
sdk.namestring | SDK name. |
sdk.versionstring | SDK version. |
modelsobject, nullable | Models used. |
models.detectorModelRef, nullable | A model and its version. Recorded on every measurement as id@version. |
locationLocation, nullable | Where and when the device took the scan, as it sent it. Kept as evidence of where the wood was measured, whether or not it matches a place. |
location.latnumber | Latitude, WGS84 degrees. |
location.lonnumber | Longitude, WGS84 degrees. |
location.accuracy_mnumber, nullable | Horizontal accuracy reported by the device, in metres. |
location.captured_atstring | When the fix was taken. |
measured_place_idstring, nullable | The place (any type, the smallest with a boundary) the scan's location lies inside, for example a yard or a landing; null when none. Where the wood was measured, not where it was harvested. |
place_matchPlaceMatch, nullable | How the location was matched to your places; null until the scan is matched. |
place_match.resultmatched \| other_tract \| ambiguous \| no_match \| accuracy_poor \| fix_stale \| no_location | |
place_match.tract_place_idstring, nullable | |
place_match.measured_place_idstring, nullable | |
place_match.inside_by_mnumber, nullable | |
place_match.accuracy_mnumber, nullable | |
place_match.candidatesarray of object | Every place with a boundary the fix was inside or within its accuracy of. |
place_match.rulestring, nullable | |
place_match.checked_atstring, nullable | |
resultsScanResults, nullable | Counts produced by the scan. Which keys are present depends on method; null or absent until the scan is estimated. |
results.countinteger | photo_count: the number of detections the client supplied on the scan's group images (no server-side count), totalled when the scan is submitted. |
results.boxes_image_idstring, nullable | photo_count: reserved for the group image whose detections are the counted logs. The boxes live on that image, not on the scan. The current build does not set it (it is absent); list the scan's group images to read the detections. |
results.matchedinteger | qr_count: tags that matched items in the group. |
results.unknowninteger | qr_count: tags seen that are not in the group. |
results.missinginteger | qr_count with intent verify: group items whose tag was not seen. |
results.unknown_tagsarray of string | qr_count: payloads counted in unknown. |
results.missing_tagsarray of string | qr_count: payloads counted in missing. |
results.sightingsinteger | qr_count: the total of the sightings the device reported (evidence; the highest count per tag). Absent when it reported none. |
replaces_scan_idstring, nullable | For untagged rescans: the earlier scan whose items this scan replaced. |
started_atstring, nullable | When capture started. |
ended_atstring, nullable | When capture ended. |
created_atstring | Creation time. |
metadataMetadata | Free-form string map for your own data (an ERP booking number, a yard row). At most 50 keys; keys up to 40 characters; values up to 500 characters. Use this instead of asking for customer-specific fields. On update, supplied keys are merged into the existing map and a key set to an empty string is removed. |
groupGroup, nullable | Present only when expand[]=group was requested. |
Start a scan#
POST/v1/scans
Starts a scan: one sitting of capture. There are four methods: qr_scale, ar_scale, qr_count (with an intent) and photo_count. qr_count and photo_count scans need a group_id (400 parameter_invalid without one). The order of a capture sync is: create the scan, upload group images, post item batches (or observations), upload item images, submit. An item image needs its item, which only an item batch creates, so item images come after the batches; everything is uploaded before the submit (Working offline). A photo_count scan is group images and nothing else; the server does not count the photo: the count is the number of detections the client supplied on the scan's group images (detections on POST /images, or the detections part of the multipart upload), and the status ends at estimated. scan.refined is never sent for a photo_count scan. Accepts JSON or form encoding. client_id is the scan's durable identity. Posting a scan whose client_id already names a scan of the account returns that scan, with 200 and no new record, when the body's method, intent, group_id and replaces_scan_id equal the stored scan's; the other fields (device, location, metadata, started_at) may differ and are ignored, the stored scan is returned as it is. When one of the four differs it is 409 client_id_conflict. This holds without a time limit, so a client whose response was lost beyond the 24-hour idempotency window creates the scan again with the same client_id, or looks it up with GET /scans?client_id=. A scan is accepted into any group at any time: one captured offline and uploaded days later is one more scan, and its settle is the group's next group.measured revision.
Keys: secret key; restricted key with scans:write; capture token (Allowed); publishable key (Allowed. The group must be one whose id the device presents (the server-first flow), or one the key opened by reference from this installation; a key with group_access: opened_only only the latter (any other group_id is 403 group_not_allowed, the same for a group of this account, of another, or none). qr_count with intent add only. Counts against scans_per_day).
Body
| Field | Description |
|---|---|
client_idstring | Your durable id for this scan (the SDKs use the journal's id). Posting the same client_id again returns the existing scan when method, intent, group_id and replaces_scan_id match, else 409 client_id_conflict. |
method requiredenum (qr_scale, ar_scale, qr_count, photo_count) | Capture method. qr_scale: measure logs scaled by a QR tag. ar_scale: measure untagged logs with AR scale. qr_count: count QR-tagged logs and reconcile against the group. photo_count: count logs in one or more group images of a group. Server-side counting is not available in the current build: the count is the number of detections the client supplied on the scan's group images (detections on POST /images; the multipart upload carries none), and the status ends at estimated. scan.refined is never sent for a photo_count scan. |
intentenum (add, remove, verify) | What a qr_count scan does against the group. add creates items for unknown tags, with an assigned measurement from the group's spec, and moves items of known tags in from other groups (not with a publishable key: 409 item_move_not_allowed); remove takes matched items out of the group; verify only reports, including the group's items that were not seen. A publishable key may use add only. |
group_idstring | Group the scan targets. |
deviceScanDevice | Device that took the scan. |
device.platformstring | e.g. ios. |
device.modelstring | Device model. |
device.osstring | OS version. |
device.app_versionstring | Host app version. |
sdkScanSdk | SDK that produced the scan. Scans created through the legacy GraphQL path report legacy-ios. |
sdk.namestring | SDK name. |
sdk.versionstring | SDK version. |
modelsobject | Models used. |
models.detectorModelRef | A model and its version. Recorded on every measurement as id@version. |
locationLocation | A device location fix. The API never infers a location; the field is null when permission was denied. |
location.lat requirednumber | Latitude, WGS84 degrees. |
location.lon requirednumber | Longitude, WGS84 degrees. |
location.accuracy_mnumber, nullable | Horizontal accuracy reported by the device, in metres. |
location.captured_atstring | When the fix was taken. |
replaces_scan_idstring | Remove the items of this earlier scan atomically when this scan is submitted. Used for rescans of untagged logs, which cannot be matched. |
started_atstring | When capture started. |
metadataMetadata | Free-form string map for your own data (an ERP booking number, a yard row). At most 50 keys; keys up to 40 characters; values up to 500 characters. Use this instead of asking for customer-specific fields. On update, supplied keys are merged into the existing map and a key set to an empty string is removed. |
app_versionstring | Version of the host app that took the scan. Stored with the device and copied into the provenance of the scan's measurements. |
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.
const result = await timbereye.scans.create({ method: "photo_count", groupId: "grp_7QxV3m" })curl -X POST https://api.timbereye.com/v1/scans \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"method":"photo_count","group_id":"grp_7QxV3m"}'timbereye scans create --method photo_count --group grp_7QxV3m --jsonResponse
// 200
{
"id": "scn_9a2Lk",
"object": "scan",
"livemode": true,
"client_id": null,
"method": "photo_count",
"intent": null,
"group_id": "grp_7QxV3m",
"status": "open",
"device": null,
"sdk": null,
"models": null,
"location": null,
"results": null,
"replaces_scan_id": null,
"measured_place_id": null,
"place_match": null,
"started_at": null,
"ended_at": null,
"created_at": "2027-02-03T14:10:02Z",
"metadata": {}
}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. |
402 | invalid_request_error: new live work is refused for billing. payment_overdue: an invoice is unpaid past its grace period; pay it or change the card in the console (Billing). spend_cap_reached: the monthly spend cap set to pause is reached; raise it or wait for the next month. Reads, and finishing scans already started, still work. |
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. |
List scans#
GET/v1/scans
Returns scans, newest first. client_id returns the scan with that client id (at most one: a client_id is unique per account), which is how a client recovers a scan after a response was lost beyond the idempotency window. A capture token may call this operation. A token limited to group_ids sees only the scans of those groups: asking for another group_id is 403 group_not_allowed, and a scan of another group, or of none, is never listed (a client_id that names one returns an empty list).
Keys: secret key; restricted key with scans:read; capture token (Allowed. A token limited to group_ids lists only the scans of those groups); publishable key (Allowed with client_id only: finds the device's own scan again (written by this key, or a key it was rolled from, from this installation)).
Parameters
| Field | Description |
|---|---|
group_idstring, query | Only scans of this group. |
methodenum (qr_scale, ar_scale, qr_count, photo_count), query | Filter by method. |
statusenum (open, processing, estimated, refined, failed), query | Filter by status. |
client_idstring, query | Only the scan with this client id (at most one). The way to find a scan again after a lost response; a capture token sees only the scans its group_ids allow. |
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
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.
for await (const scan of timbereye.scans.list()) {
// every page, one at a time
}curl https://api.timbereye.com/v1/scans \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"timbereye scans list --jsonResponse
// 200
{
"object": "list",
"data": [
{
"id": "scn_9a2Lk",
"object": "scan",
"livemode": true,
"client_id": null,
"method": "photo_count",
"intent": null,
"group_id": "grp_7QxV3m",
"status": "open",
"device": null,
"sdk": null,
"models": null,
"location": null,
"results": null,
"replaces_scan_id": null,
"measured_place_id": null,
"place_match": null,
"started_at": null,
"ended_at": null,
"created_at": "2027-02-03T14:10:02Z",
"metadata": {}
}
],
"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. |
Retrieve a scan#
GET/v1/scans/{id}
Returns the scan, its status and results.
Keys: secret key; restricted key with scans:read; capture token (Allowed); publishable key (Allowed for the device's own scans. expand[]=group returns group: null).
Parameters
| Field | Description |
|---|---|
id requiredstring, path | Scan 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
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.
const result = await timbereye.scans.retrieve("scn_9a2Lk")curl https://api.timbereye.com/v1/scans/scn_9a2Lk \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"timbereye scans get scn_9a2Lk --jsonResponse
// 200
{
"id": "scn_9a2Lk",
"object": "scan",
"livemode": true,
"client_id": null,
"method": "photo_count",
"intent": null,
"group_id": "grp_7QxV3m",
"status": "open",
"device": null,
"sdk": null,
"models": null,
"location": null,
"results": null,
"replaces_scan_id": null,
"measured_place_id": null,
"place_match": null,
"started_at": null,
"ended_at": null,
"created_at": "2027-02-03T14:10:02Z",
"metadata": {}
}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. |
Read back a scan's logs#
GET/v1/scans/{id}/items
The logs this scan measured, each with this scan's own latest measurement (the server-refined one once refinement succeeded, else the scan's device estimate) and its refinement status, so a phone can mark its own logs final. final is true once refinement has finished (succeeded, or failed so the estimate stands); a log whose image has not arrived has refinement: null and is not final. Never another scan's measurement of the same log, an office override, or anything else about the group: for the full item use GET /items/{id}. client_id is the one this scan sent when the scan created the log, null when the log existed already. Ordered by item id; at most 100 a page.
Keys: secret key; restricted key with scans:read; capture token (Allowed within the token's group_ids); publishable key (Allowed for the device's own scans (this key or a key it was rolled from, from this installation); anything else is 404. Returns only that scan's own measurements).
Parameters
| Field | Description |
|---|---|
id requiredstring, path | Scan id. |
limitinteger, query | Page size, 1 to 100. |
starting_afterstring, query | The next_cursor of the previous page (an item id). |
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.
for await (const scan of timbereye.scans.listItems("scn_9a2Lk")) {
// every page, one at a time
}curl https://api.timbereye.com/v1/scans/scn_9a2Lk/items \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"timbereye scans items scn_9a2Lk --jsonResponse
200: a ScanItemStatusList object.
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. |
Send device estimates#
POST/v1/scans/{id}/items
Creates items with their device estimates, in batches of at most 100. Items come before their images: an item image needs its item, so upload item images (POST /images with item_id, or the multipart upload with item_id or item_client_id) after the batch that creates the item. Not used by qr_count or photo_count scans. The response is { object: "list", data } with one entry per input item, in input order, not paginated (has_more is always false, next_cursor null). Each entry is the item with its effective measurement, plus created, and its client_id is the input's client_id (the stored item's own differs when the tag already existed). Items and measurements are idempotent by the scan and the item's client_id, not by the batch's Idempotency-Key: sending an item again, under the same key, a new key or in another batch, returns the stored item and adds no second device_estimate measurement. A batch whose response was lost can therefore be posted again at any time while the scan is open. created is true only on the call that created the item; it is false when the tag already existed in the account (the measurement is added to the existing item, which keeps its own client_id, species, length and grade, and the entry carries that item's id) and false on a repeat. A client_id that names an item of another scan, for a tag that has no item yet, is 409 client_id_conflict. Each item needs a device_estimate measurement. grade is stored with source operator (the group's default grade, source group_default, when omitted); like species and length it applies when the item is created, not to an existing item that is measured again. length.source is stored as sent when it is operator, group_default or measured (see ItemLengthInput). measurement.image_id links an item image that was uploaded earlier to the measurement: it must be an uploaded item image of this scan and of this item, so it can only accompany a further measurement of an item that an earlier batch of the scan created (a measurement cannot be edited afterwards). Otherwise upload the image after the item exists; completing the upload queues refinement. A wrong image is a 400 parameter_invalid, an unknown one a 404, and one that has not been uploaded a 409. A scan that is no longer open refuses items with 409 state_conflict.
Keys: secret key; restricted key with scans:write; capture token (Allowed); publishable key (Allowed on the device's own scans. Counts against items_per_day. A tag whose item is in another group is 409 item_move_not_allowed (a phone signed in to the app moves it with allow_move: true once the worker confirmed); each entry carries this device's own estimate as measurement).
Parameters
| Field | Description |
|---|---|
id requiredstring, path | Scan id. |
Body
| Field | Description |
|---|---|
items requiredarray of ScanItemInput | Items from the device, batched. |
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.
const result = await timbereye.scans.addItems("scn_9a2Lk", {
items: [{
clientId: "c6f1e2a4-3d58-4a8e-9b1c-0f6e7d2a9b11",
tag: { payload: "TE-4F7K2Q1", symbology: "qr", sideMm: 62 },
species: "PINE_TAEDA",
length: { valueM: 11.8, source: "group_default" },
measurement: {
stage: "device_estimate",
method: "qr_scale",
diameterShortM: 0.231,
diameterLongM: 0.247,
scale: { source: "qr_tag", mPerUnitX: 0.512, mPerUnitY: 0.509 },
imageId: "img_K3s9",
},
}],
})curl -X POST https://api.timbereye.com/v1/scans/scn_9a2Lk/items \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"client_id": "c6f1e2a4-3d58-4a8e-9b1c-0f6e7d2a9b11",
"tag": {
"payload": "TE-4F7K2Q1",
"symbology": "qr",
"side_mm": 62
},
"species": "PINE_TAEDA",
"length": { "value_m": 11.8, "source": "group_default" },
"measurement": {
"stage": "device_estimate",
"method": "qr_scale",
"diameter_short_m": 0.231,
"diameter_long_m": 0.247,
"scale": {
"source": "qr_tag",
"m_per_unit_x": 0.512,
"m_per_unit_y": 0.509
},
"image_id": "img_K3s9"
}
}
]
}'timbereye scans add-items scn_9a2Lk \
--data '{"items":[{"client_id":"c6f1e2a4-3d58-4a8e-9b1c-0f6e7d2a9b11","tag":{"payload":"TE-4F7K2Q1","symbology":"qr","side_mm":62},"species":"PINE_TAEDA","length":{"value_m":11.8,"source":"group_default"},"measurement":{"stage":"device_estimate","method":"qr_scale","diameter_short_m":0.231,"diameter_long_m":0.247,"scale":{"source":"qr_tag","m_per_unit_x":0.512,"m_per_unit_y":0.509},"image_id":"img_K3s9"}}]}' \
--jsonResponse
// 200
{
"object": "list",
"has_more": false,
"next_cursor": null,
"data": [
{
"id": "itm_5Lw2Nc",
"object": "item",
"livemode": true,
"client_id": null,
"type": "log",
"group_id": "grp_7QxV3m",
"tag": {
"payload": "DEMO-0001",
"symbology": "qr",
"side_mm": 62
},
"species": "PINE_TAEDA",
"length": {
"value_m": 5.8,
"source": "operator",
"entered": { "value": 5.8, "unit": "m" }
},
"grade": null,
"weight": null,
"measurement": {
"id": "msr_6Ny2Hc",
"object": "measurement",
"livemode": true,
"item_id": "itm_5Lw2Nc",
"stage": "device_estimate",
"method": "qr_scale",
"diameter_short_m": 0.471,
"diameter_long_m": 0.489,
"adjustments": [],
"effective_short_m": 0.471,
"effective_long_m": 0.489,
"perimeter": null,
"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": null,
"sdk_version": "timbereye-ios 1.4.0",
"app_version": "3.2.1",
"device_model": "iPhone15,3",
"os": "iOS 18.2",
"actor": {
"type": "key",
"id": null
}
},
"reason": null,
"image_id": null,
"scan_id": "scn_9a2Lk",
"created_at": "2027-02-03T14:12:40Z"
},
"refinement": { "status": "queued" },
"outline": {
"status": "pending",
"reason": "segmentation_queued",
"source": null,
"points": null,
"measurement_id": null,
"segmenter": null
},
"status": "active",
"scan_id": "scn_9a2Lk",
"origin": null,
"measured": null,
"metadata": {},
"created_at": "2027-02-03T14:12:40Z",
"created": true
}
]
}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. |
Send QR count observations#
POST/v1/scans/{id}/observations
For qr_count scans: the tag payloads the device saw, in batches of at most 500, each with an optional sightings count, reconciled against the group. Intent add: a tag already in the group is matched; a tag nobody has becomes an item with an assigned measurement from the group's defaults (422 assignment_required when the spec cannot supply one); a tag whose item is in another group moves it into this one, except with a publishable key, which cannot move items (409 item_move_not_allowed), and a phone signed in to the app, which moves it once the worker confirmed (allow_move on the observation). Intent remove takes matched items out of the group and verify only reports (matched, unknown, and missing for the group's items not seen); a publishable key may use add only, so it never learns the group's other tags. Idempotent by tag payload, not by the batch's Idempotency-Key: a tag already recorded by this scan is not counted again, so a batch posted again under a new key leaves the results unchanged, and sightings keeps the highest count reported per tag. A scan that is no longer open refuses observations with 409 state_conflict.
Keys: secret key; restricted key with scans:write; capture token (Allowed); publishable key (Allowed on the device's own scans. Counts against items_per_day. A tag whose item is in another group is 409 item_move_not_allowed (a phone signed in to the app moves it with allow_move: true on the observation once the worker confirmed)).
Parameters
| Field | Description |
|---|---|
id requiredstring, path | Scan id. |
Body
| Field | Description |
|---|---|
observations requiredarray of Observation | Tags seen, deduplicated by payload by the device. |
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.
const result = await timbereye.scans.addObservations("scn_9a2Lk", {
observations: [{
payload: "DEMO-0001",
symbology: "qr",
observedAt: "2027-02-03T14:20:11Z",
sightings: 3,
}, {
payload: "DEMO-0002",
symbology: "qr",
observedAt: "2027-02-03T14:20:14Z",
sightings: 1,
}],
})curl -X POST https://api.timbereye.com/v1/scans/scn_9a2Lk/observations \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"observations": [
{
"payload": "DEMO-0001",
"symbology": "qr",
"observed_at": "2027-02-03T14:20:11Z",
"sightings": 3
},
{
"payload": "DEMO-0002",
"symbology": "qr",
"observed_at": "2027-02-03T14:20:14Z",
"sightings": 1
}
]
}'timbereye scans add-observations scn_9a2Lk \
--data '{"observations":[{"payload":"DEMO-0001","symbology":"qr","observed_at":"2027-02-03T14:20:11Z","sightings":3},{"payload":"DEMO-0002","symbology":"qr","observed_at":"2027-02-03T14:20:14Z","sightings":1}]}' \
--jsonResponse
// 200
{
"id": "scn_9a2Lk",
"object": "scan",
"livemode": true,
"client_id": null,
"method": "photo_count",
"intent": null,
"group_id": "grp_7QxV3m",
"status": "open",
"device": null,
"sdk": null,
"models": null,
"location": null,
"results": null,
"replaces_scan_id": null,
"measured_place_id": null,
"place_match": null,
"started_at": null,
"ended_at": null,
"created_at": "2027-02-03T14:10:02Z",
"metadata": {}
}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. |
Submit a scan#
POST/v1/scans/{id}/submit
Closes capture and starts processing. For qr_scale and ar_scale the status moves open, processing, estimated, refined; follow it by polling or by the scan.estimated and scan.refined webhooks. Refinement typically takes seconds after the image upload; the queue is picked up every minute. A qr_count scan never refines (its items carry assigned measurements): submitting it sets the status straight to refined, never estimated, and sends scan.refined. A photo_count scan has no refinement either: submitting totals the supplied detections, the status becomes estimated and stays there, and scan.refined is not sent. The optional ended_at records when capture ended on the device (default: now); it may not be before started_at. Submitting is idempotent: submitting a scan that is no longer open returns it as it is, with 200 and whatever status it has reached, and changes nothing (ended_at is ignored then). Submit after every item batch, observation batch and image upload; an image whose upload completes afterwards is still stored, but a photo_count total is not recomputed.
Keys: secret key; restricted key with scans:write; capture token (Allowed); publishable key (Allowed on the device's own scans).
Parameters
| Field | Description |
|---|---|
id requiredstring, path | Scan id. |
Body
| Field | Description |
|---|---|
ended_atstring | When capture ended on the device. Defaults to the time of the call; may not be before the scan's started_at. Ignored when the scan was submitted already. |
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.
const result = await timbereye.scans.submit("scn_9a2Lk", { endedAt: "2027-02-03T14:22:30Z" })curl -X POST https://api.timbereye.com/v1/scans/scn_9a2Lk/submit \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"ended_at":"2027-02-03T14:22:30Z"}'Response
// 200
{
"id": "scn_9a2Lk",
"object": "scan",
"livemode": true,
"client_id": null,
"method": "photo_count",
"intent": null,
"group_id": "grp_7QxV3m",
"status": "open",
"device": null,
"sdk": null,
"models": null,
"location": null,
"results": null,
"replaces_scan_id": null,
"measured_place_id": null,
"place_match": null,
"started_at": null,
"ended_at": null,
"created_at": "2027-02-03T14:10:02Z",
"metadata": {}
}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. |
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. |