What gets consumed and what is in stock: materials, categories, inventory, lifespans.
Dates and times
Send a date as Y-m-d and a date with a time as Y-m-d H:i:s, for
example 2026-08-28 and 2026-08-28 14:30:00. Values are read in the
company time zone. Other spellings PHP can parse are usually accepted, but a slash-separated
date is read month-first, so send Y-m-d and avoid the ambiguity. A duration is
HH:MM or HH:MM:SS, or a plain number of seconds.
Responses return dates and times in ISO 8601 with the offset, for example
2026-08-28T14:30:00+0300. The Return table below lists the fields of the response
and their types; it has no description column for them, so the format above is the one to
assume for every DateTime field it shows.
Inventory here tracks whether a machine is in use, in storage or under maintenance,
rather than counting stock. Registering an event moves a facility from one state to
another and writes a log entry. These endpoints record the event and read the log for one
machine. The log is append-only, so the history of a machine can be reconstructed. Material
stock levels are handled under Materials instead.
POST
/api/inventory_facility/{facility_id}/{event_name}
Change Inventory status by registering event
Documentation
Sandbox
Documentation
Adds new Event to Facility Inventory Log
Requirements
Name
Requirement
Type
Description
facility_id
integer|string
Facility id
event_name
Parameters
Parameter
Type
Required?
Format
Description
facility_id
integer
true
Facility id
event_name
string
true
Event name.
another_worker_id
integer
false
Worker id when assigning inventory to third person
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
List of Facilities logged in person is currently owning
Documentation
Sandbox
Documentation
List of Facilities logged in person is currently owning
Parameters
Parameter
Type
Required?
Format
Description
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (inventory, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Return
Parameter
Type
Versions
Description
200
classificator
string
*
id
integer
*
Facility Id in Terake
fullname
string
*
Facility fullname, Utf8 string 255 chars
slug
string
*
reg_number
string
*
Vehicle registration number (licence plate number), string
is_main_facility
boolean
*
True if Facility is main facility
is_secondary_facility
boolean
*
True if Facility is secondary facility (implement, trailer)
is_replaceable
boolean
*
True if facility is easily replacable (has big stock)
is_maintainable
boolean
*
True if facility is maintaineable unit
storage_worker
object (Worker)
*
Person responsible for storage
last_inventory_log
object (InventoryFacilityLog)
*
Last (in force) entry in Inventory Log
nfc
string
*
Facility NFC code
qr
string
*
Facility QR code
This is copy of QrImage->QrText parameter for fast querying in lists
Finds and returns Object by ID, UUID NFC Code, or QR Code.
Supported object types are: Facility (including 'implement' and 'maintenance unit'), Material, Worker, Worktype, Shift, Project, ProjectFacility, ProjectMaintenanceUnit, ProjectMaterial, ProjectWorker, ProjectWorktype.
Returns error if more than one Entity found, or if no entites found.
Users are advised to keep NFC codes unique (ID's and UUID's are quaranteed to be unique)
Requirements
Name
Requirement
Type
Description
query
string
id, uuid, NFC code, QR-code, or reg.Number (for Facilities)
Parameters
Parameter
Type
Required?
Format
Description
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (inventory, baseattribute, search, shiftitem). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Return
Parameter
Type
Versions
Description
200
classificator
string
*
id
integer
*
Facility Id in Terake
name
string
*
Facility name, Utf8 string 255 chars
fullname
string
*
Facility fullname, Utf8 string 255 chars
slug
string
*
reg_number
string
*
Vehicle registration number (licence plate number), string
is_main_facility
boolean
*
True if Facility is main facility
is_secondary_facility
boolean
*
True if Facility is secondary facility (implement, trailer)
is_replaceable
boolean
*
True if facility is easily replacable (has big stock)
is_maintainable
boolean
*
True if facility is maintaineable unit
storage_worker
object (Worker)
*
Person responsible for storage
agrifield
object (Agrifield)
*
Main Location (Address) of Maintenance unit
customer
object (Customer)
*
customer_person
object (CustomerPerson)
*
Customer contact person
last_inventory_log
object (InventoryFacilityLog)
*
Last (in force) entry in Inventory Log
nfc
string
*
Facility NFC code
qr
string
*
Facility QR code
This is copy of QrImage->QrText parameter for fast querying in lists
List of Facilities logged in person is currently using
Documentation
Sandbox
Documentation
List of Facilities logged in person is currently using
Parameters
Parameter
Type
Required?
Format
Description
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (inventory, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Return
Parameter
Type
Versions
Description
200
classificator
string
*
id
integer
*
Facility Id in Terake
fullname
string
*
Facility fullname, Utf8 string 255 chars
slug
string
*
reg_number
string
*
Vehicle registration number (licence plate number), string
is_main_facility
boolean
*
True if Facility is main facility
is_secondary_facility
boolean
*
True if Facility is secondary facility (implement, trailer)
is_replaceable
boolean
*
True if facility is easily replacable (has big stock)
is_maintainable
boolean
*
True if facility is maintaineable unit
storage_worker
object (Worker)
*
Person responsible for storage
last_inventory_log
object (InventoryFacilityLog)
*
Last (in force) entry in Inventory Log
nfc
string
*
Facility NFC code
qr
string
*
Facility QR code
This is copy of QrImage->QrText parameter for fast querying in lists
Look the record up by uuid instead of the id in the path.
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (inventory, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
A material category groups materials that behave alike - fertilisers, seeds, plant
protection products, fuel, spare parts. Category decides how a material is treated in
fertilising calculations and reports. These endpoints create, edit, archive and delete
categories. The list is shared with partner companies and archived in two levels. Category
5 is the one work units are filed under.
GET
/api/material-categories
MaterialCategory collection
Documentation
Sandbox
Documentation
Returns MaterialCategory collection
Parameters
Parameter
Type
Required?
Format
Description
is_archived
boolean
false
Show archived records
archived
boolean
false
Alias of is_archived; either being truthy has the same effect.
from_updated_at
integer
false
Records updated from Unix timestamp.
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (archive, material_category_all, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Return
Parameter
Type
Versions
Description
200
fullname
string
*
id
integer
*
name
string
*
Material Category name, user defined. Required.
shortname
string
*
slug
string
*
Material Category translation slug. Filled for categories provided by Terake and if exists, should be preferred over Name.
Look the record up by uuid instead of the id in the path.
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (archive, material_category_all, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Return
Parameter
Type
Versions
Description
200
fullname
string
*
id
integer
*
name
string
*
Material Category name, user defined. Required.
shortname
string
*
slug
string
*
Material Category translation slug. Filled for categories provided by Terake and if exists, should be preferred over Name.
A Material is anything consumed by work: seed, fertiliser, chemicals, spare parts, or a
work unit charged by the hour. Materials carry their category, unit, composition and
certificates. These endpoints create and edit materials, record inventory levels, assign
lifespans and read stock over the last two months. Material usage links a material to a
Workdone, plan item or inspection, which is how consumption is reported. The workunits
routes serve the same entity with a different category.
GET
/api/lifespan-type
Lifespan Types collection
Documentation
Sandbox
Documentation
Returns Lifespan Types
Parameters
Parameter
Type
Required?
Format
Description
is_archived
boolean
false
Truthy returns archived records instead of active ones.
archived
boolean
false
Alias of is_archived; either being truthy has the same effect.
from_updated_at
integer
false
Records updated from Unix timestamp
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (archive, material_category_all, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Look the record up by uuid instead of the id in the path.
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (archive, material_category_all, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Truthy returns archived records instead of active ones.
archived
boolean
false
Alias of is_archived; either being truthy has the same effect.
from_updated_at
integer
false
Records updated from Unix timestamp
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (material, owner, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Return
Parameter
Type
Versions
Description
200
_amount
double
*
id
integer
*
name
string
*
Material name. Required.
fullname
string
*
Material fullname, calculated value
slug
string
*
category_name
string
*
amount_category
object (AmountCategory)
*
Amount category. Required.
calc_amount_category
object (AmountCategory)
*
material_category
object (MaterialCategory)
*
Material category. Required.
formula_n
string
*
formula_p
string
*
formula_k
string
*
formula_s
string
*
formula_mg
string
*
formula_ca
string
*
outer_id
string
*
batch_number
string
*
is_coated_seed
boolean
*
is_coating_material
boolean
*
is_material
boolean
*
is_product
boolean
*
cost_per_unit
float
*
Net cost (Purchase price)
price_per_unit
float
*
Sale price
qr
string
*
QR code
This is copy of QrImage->QrText parameter for fast querying in lists
Look the record up by uuid instead of the id in the path.
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (material_all, sharing, owner, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Return
Parameter
Type
Versions
Description
200
classificator
string
*
name_extended
string
*
_amount
double
*
partner_ids
array
*
id
integer
*
name
string
*
Material name. Required.
fullname
string
*
Material fullname, calculated value
slug
string
*
category_name
string
*
amount_category
object (AmountCategory)
*
Amount category. Required.
calc_amount_category
object (AmountCategory)
*
material_category
object (MaterialCategory)
*
Material category. Required.
crop
object (Crop)
*
In case of Seed (Material_category_id = 2), or Harvest (Material_category_id = 13) crop
material_certificate
object (MaterialCertificate)
*
Material certificate
material_type
object (MaterialType)
*
Material sub-type
(TKV_MATERJAL, VAETAMISE_MATERJAL/FERT_MATERIAL )
material_second_type
object (MaterialType)
*
Material second sub-type
vaetiseliik/FERT_TYPE
master_material
object (Material)
*
Master Material
(nt. taimekaitsevahend PRIA registrist, väetis regitrist)
Harvest Material composition by ID or UUID. Returns the harvest source rows as { name, amount }
Requirements
Name
Requirement
Type
Description
id
integer|string
Material id or uuid
Parameters
Parameter
Type
Required?
Format
Description
uuid
string
false
Look the record up by uuid instead of the id in the path.
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (material_all, sharing, owner, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
MaterialInventory id. Only when modifying an existing record; leave it out to create a new one.
material_id
integer|string
Material id
Parameters
Parameter
Type
Required?
Format
Description
material_inventory_id
integer
false
Existing inventory record to update. Omit to create one. On the PUT route it comes from the URL instead. Only when modifying an existing record; leave it out to create a new one.
amount
float
true
Counted amount of the material.
storage
object
false
Storage location, as an object with an id field.
document_type
object
false
Document type backing the count, as an object with an id field.
inventory_time
datetime
false
YYYY-MM-DD HH:MM:SS
Time the count was taken. Defaults to now. Date and time as Y-m-d H:i:s, for example 2026-08-28 14:30:00.
description
string
false
Free-text note on the count.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Deletes a Material inventory record. Removed permanently rather than soft-deleted, so the row
does not appear in the recycle bin or in a from_updated_at delta sync. Returns an empty array
Requirements
Name
Requirement
Type
Description
material_id
integer|string
Material id
material_inventory_id
integer|string
MaterialInventory id
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
GET
/api/materials/{material_id}/inventory/{material_inventory_id}
Returns one MaterialInventory record for a material, by inventory id.
Documentation
Sandbox
Documentation
Get MaterialInventory
Requirements
Name
Requirement
Type
Description
material_id
integer|string
Material id
material_inventory_id
integer|string
MaterialInventory id
Parameters
Parameter
Type
Required?
Format
Description
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (material_inventory, owner, baseattribute, auditcolumns). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
PUT
/api/materials/{material_id}/inventory/{material_inventory_id}
Creates or modifies a Material inventory record
Documentation
Sandbox
Documentation
Creates MaterialInventory baseline
Requirements
Name
Requirement
Type
Description
material_inventory_id
integer|string
MaterialInventory id. Only when modifying an existing record; leave it out to create a new one.
material_id
integer|string
Material id
Parameters
Parameter
Type
Required?
Format
Description
material_inventory_id
integer
false
Existing inventory record to update. Omit to create one. On the PUT route it comes from the URL instead. Only when modifying an existing record; leave it out to create a new one.
amount
float
true
Counted amount of the material.
storage
object
false
Storage location, as an object with an id field.
document_type
object
false
Document type backing the count, as an object with an id field.
inventory_time
datetime
false
YYYY-MM-DD HH:MM:SS
Time the count was taken. Defaults to now. Date and time as Y-m-d H:i:s, for example 2026-08-28 14:30:00.
description
string
false
Free-text note on the count.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Removes a lifespan assignment from a Material. The row is deleted permanently rather than soft-
deleted, because material_lifespan carries a unique index. Returns { id, is_deleted: true }
Requirements
Name
Requirement
Type
Description
parent_id
integer|string
Material ID or UUID
id
integer|string
Material Lifespan ID or UUID
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Comma-separated subset of the serializer groups this endpoint offers (material, material_all, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Truthy returns archived records instead of active ones.
archived
boolean
false
Alias of is_archived; either being truthy has the same effect.
from_updated_at
integer
false
Records updated from Unix timestamp
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (material, owner, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Return
Parameter
Type
Versions
Description
200
_amount
double
*
id
integer
*
name
string
*
Material name. Required.
fullname
string
*
Material fullname, calculated value
slug
string
*
category_name
string
*
amount_category
object (AmountCategory)
*
Amount category. Required.
calc_amount_category
object (AmountCategory)
*
material_category
object (MaterialCategory)
*
Material category. Required.
formula_n
string
*
formula_p
string
*
formula_k
string
*
formula_s
string
*
formula_mg
string
*
formula_ca
string
*
outer_id
string
*
batch_number
string
*
is_coated_seed
boolean
*
is_coating_material
boolean
*
is_material
boolean
*
is_product
boolean
*
cost_per_unit
float
*
Net cost (Purchase price)
price_per_unit
float
*
Sale price
qr
string
*
QR code
This is copy of QrImage->QrText parameter for fast querying in lists
Look the record up by uuid instead of the id in the path.
groups
string
false
Comma-separated subset of the serializer groups this endpoint offers (material_all, sharing, owner, baseattribute). Narrows the response to those groups, dropping the nested objects the others add; a group not offered here is refused with 400.
Headers
Name
Required?
Description
X-Terake-Api-Key
false
Worker or token api key. The preferred way to authenticate; send this or the apikey query parameter.
Return
Parameter
Type
Versions
Description
200
classificator
string
*
name_extended
string
*
_amount
double
*
partner_ids
array
*
id
integer
*
name
string
*
Material name. Required.
fullname
string
*
Material fullname, calculated value
slug
string
*
category_name
string
*
amount_category
object (AmountCategory)
*
Amount category. Required.
calc_amount_category
object (AmountCategory)
*
material_category
object (MaterialCategory)
*
Material category. Required.
crop
object (Crop)
*
In case of Seed (Material_category_id = 2), or Harvest (Material_category_id = 13) crop
material_certificate
object (MaterialCertificate)
*
Material certificate
material_type
object (MaterialType)
*
Material sub-type
(TKV_MATERJAL, VAETAMISE_MATERJAL/FERT_MATERIAL )
material_second_type
object (MaterialType)
*
Material second sub-type
vaetiseliik/FERT_TYPE
master_material
object (Material)
*
Master Material
(nt. taimekaitsevahend PRIA registrist, väetis regitrist)