REST API
Overview of the Timbereye REST API - base URL, test and live, authentication and key types, request and response conventions - with links to each resource's reference page.
Reference for all three steps. Each resource page below says which calls you make to Create, Scan and Sync.
The API is JSON over HTTPS. The OpenAPI 3.1 document, timbereye.v1.yaml, is the source of truth; the resource pages are generated from it.
Base URL, test and live#
https://api.timbereye.com/v1There is one base URL. The key decides the mode: a te_test_ key sees only the test account, a te_live_ key only the live one, and test and live data never mix. Every object carries livemode. Test mode is free and has the simulator; an owner turns live mode on in the console by accepting the terms and adding a card. See Going live.
Authentication#
Send a key as a bearer token. The account behind the key:
const timbereye = new Timbereye() // reads TIMBEREYE_SECRET_KEY
const account = await timbereye.account.retrieve()curl https://api.timbereye.com/v1/account \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"timbereye account get --json{
"id": "acct_1Fq8Zt",
"object": "account",
"livemode": false,
"mode": "test",
"display_units": "metric",
"default_volume_rule": "jas"
}| Credential | Looks like | Where it lives | Reach |
|---|---|---|---|
| Secret key | te_test_sk_... | Your server only | Everything in the account |
| Restricted key | te_test_rk_... | Your server, a script or CI | The scopes you gave it (groups:write, scans:write) |
| Capture token | te_test_ct_... | A phone, for a short time | Scanning into the groups your server minted it for |
| Publishable key | te_test_pk_... | Built into your app | Capture only, with daily limits; never reads your data |
No key gives 401 authentication_required; a key without the scope gives 403 scope_missing. Keys, scopes and capture tokens are in Keys.
A request with a publishable key also sends Timbereye-Installation-Id, a lowercase UUID the app creates once per install (required: 400 installation_id_required without it), and Timbereye-App-Id, the bundle id or package name (required when the key restricts apps). The mobile SDKs send both. See Keys.
Conventions#
- JSON in and out, UTF-8. Field names are snake_case.
POST /groupsalso accepts form encoding. - ID prefixes say the type:
grp_group,itm_item (a piece: a log),msr_measurement,scn_scan,img_image,plc_place,spc_species,tgb_tag batch,lbt_label template,evt_event,whk_webhook endpoint,whd_webhook delivery,acct_account. Every object hasid,objectandlivemode. - Units the API uses: sawlog lengths and diameters in metres (
value_m,diameter_short_m), volume in cubic metres (m3), weight in kilograms (net_kg). Inputs may carry a unit ({ "value": 19, "unit": "ft" }); a baretonis refused as ambiguous. Lumber and panel sizes keep the unit they were entered in, such as{ "value": 2, "unit": "in" }, with board feet beside nominal m³. - Timestamps are ISO 8601 in UTC (
2027-02-03T14:41:09Z). - How much
metadatayou can attach: it is your own string map on groups, items, scans and places, up to 50 keys, keys up to 40 characters, values up to 500.GET /groups?metadata[booking]=B123filters on it. expand[]on some reads embeds a related object, for exampleGET /groups/{id}?expand[]=origin_place. Each resource lists what it allows.versionon a group increases with every change. Send it asIf-Matchto avoid overwriting someone else's edit (412 version_mismatch).- Unknown fields and enum values may appear within v1. Ignore them. Breaking changes need a new major version.
Idempotency, errors and paging#
- Every
POSTthat changes state needs anIdempotency-Keyheader; a retry with the same key returns the first result. - Every error has one shape,
{ "error": { "type", "code", "message", "param", "request_id" } }; switch oncode. - Lists are cursor-paginated with
limitandstarting_after. - Every response has a
Request-Idheader. Rate limits are per account and per second.
All of it, with every error code: Errors, idempotency and pagination.
Resources#
| Resource | What it is for |
|---|---|
| Groups | Create: the container, truck load or stack; open one by reference |
| Group items | Move logs into and out of a group; change many at once |
| Items | Read: the pieces |
| Measurements | A log's measurement history; manual overrides |
| Volume | Volume of a group or a log under a rule; the rules |
| Origin | A group's origin places as GeoJSON |
| Scans | Scan: the record of a sitting of scanning. The scanner calls these |
| Images | Photos of groups and log ends |
| Capture tokens | Scan: short-lived credentials for phones |
| Events | Sync: the event feed, and the webhook payloads |
| Webhook endpoints | Sync: where events are sent |
| Places | Tracts, yards, mills and ports, with geometry checks |
| Species | Your species catalogue |
| Test mode | The simulator |
| Models | The log detector download for phones |
| Usage | What has been counted for billing |
| Account | Your account, mode and defaults |
| API keys | Key management, from the developer console |
| Team | Members and invitations, from the developer console |
| Audit log | Who did what in the account; console only, never an API key |
The TypeScript SDK has one method per operation: see TypeScript SDK. The CLI has one command per operation: see Command line.