Skip to the page
Docs menu

Docs API reference

Capture tokens

Short-lived device tokens.

The capture token object#

A short-lived device token scoped to capture. Offline capture needs no token; the device asks the host app for one when it syncs.

FieldDescription
objectcapture_tokenString representing the object type. Always capture_token.
livemodebooleantrue for objects in the live account, false for objects in the test account. Test and live data never mix.
key_idstringThe 12-character key id inside the token.
secretstring, nullableThe token, te_live_ct_<keyid>_<secret> (te_test_ct_ in test mode). Shown once. Pass it to the SDK's token provider. Null on an idempotent replay of the mint, because the token is never stored for replay; mint a new one. Devices never hold secret keys.
expires_atstringWhen the token stops working.
group_idsarray of string, nullableGroups the token is limited to; null when unrestricted.
specread \| writeSpec access.

Mint a capture token#

POST/v1/capture_tokens

Called by your server for a device. The token lasts one hour by default and at most 24 hours, and can be limited to group ids. Only a secret key may mint tokens; restricted keys and capture tokens cannot. Key management (create, roll, revoke) is dashboard-only and not part of this API.

Keys: secret key.

Body

FieldDescription
ttl_secondsintegerLifetime in seconds. Default 3600 (1 hour), maximum 86400 (24 hours).
group_idsarray of stringLimit the token to these groups. Omit for any group in the account.
specread \| writeWhether the field user may change a group's spec (defaults). read shows it; write also lets the device edit it.

Request

TypeScript
const result = await timbereye.captureTokens.create({ ttlSeconds: 3600, groupIds: ["grp_7QxV3m"] })
curl
curl -X POST https://api.timbereye.com/v1/capture_tokens \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"ttl_seconds":3600,"group_ids":["grp_7QxV3m"]}'
CLI
timbereye capture-tokens create \
  --data '{"ttl_seconds":3600,"group_ids":["grp_7QxV3m"]}' \
  --json

Response

JSON
// 200
{
  "object": "capture_token",
  "livemode": true,
  "key_id": "3kXq9TnB7mLp",
  "secret": "te_live_ct_3kXq9TnB7mLp_<secret>",
  "expires_at": "2027-02-03T15:05:00Z",
  "group_ids": ["grp_7QxV3m"],
  "spec": "read"
}
Errors
StatusWhen
400invalid_request_error: the request was malformed or a field was invalid.
401authentication_error: missing, malformed, expired or revoked key.
402invalid_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.
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.