API Reference
Fields
The individual plots that make up a farm, including boundaries and metadata.
get
/fields/{field_id}Get a field by id
Requires an
Authorization: Bearer header.Parameters
field_idstringpathrequiredResponse 200
field_idstringrequiredfarm_idstringrequirednamestringrequiredfield_typeenum<string>optionalField type enum
open_fieldgreenhouseforestotherfield_statusenum<string>optionalField status enum
fallowharvestedplantedploughedlatitudenumberrequiredlongitudenumberrequiredarea_hanumberrequiredaddressstringoptionalcitystringoptionalstatestringoptionalcountrystringoptionalgeomobjectrequiredis_activebooleanrequiredcreated_atstring<date-time>requiredupdated_atstring<date-time>requiredGET /fields/{field_id}
curl -X GET "https://api.cropsense.africa/fields/8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Example response · 200
{
"field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
"farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
"name": "Green Valley Farm",
"field_type": "open_field",
"field_status": "fallow",
"latitude": 1.5,
"longitude": 1.5,
"area_ha": 1.5,
"address": "address",
"city": "city",
"state": "state",
"country": "Kenya",
"geom": {},
"is_active": true,
"created_at": "2026-06-15T09:30:00Z",
"updated_at": "2026-06-15T09:30:00Z"
}put
/fields/{field_id}Update a field by id
Requires an
Authorization: Bearer header.Parameters
field_idstringpathrequiredRequest body
namestringoptionalfield_typeenum<string>optionalField type enum
open_fieldgreenhouseforestotherfield_statusenum<string>optionalField status enum
fallowharvestedplantedploughedgeomobjectoptionalupdated_atstring<date-time>optionalResponse 200
field_idstringrequiredfarm_idstringrequirednamestringrequiredfield_typeenum<string>optionalField type enum
open_fieldgreenhouseforestotherfield_statusenum<string>optionalField status enum
fallowharvestedplantedploughedlatitudenumberrequiredlongitudenumberrequiredarea_hanumberrequiredaddressstringoptionalcitystringoptionalstatestringoptionalcountrystringoptionalgeomobjectrequiredis_activebooleanrequiredcreated_atstring<date-time>requiredupdated_atstring<date-time>requiredPUT /fields/{field_id}
curl -X PUT "https://api.cropsense.africa/fields/8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Green Valley Farm",
"field_type": "open_field",
"field_status": "fallow",
"geom": {},
"updated_at": "2026-06-15T09:30:00Z"
}'Example response · 200
{
"field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
"farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
"name": "Green Valley Farm",
"field_type": "open_field",
"field_status": "fallow",
"latitude": 1.5,
"longitude": 1.5,
"area_ha": 1.5,
"address": "address",
"city": "city",
"state": "state",
"country": "Kenya",
"geom": {},
"is_active": true,
"created_at": "2026-06-15T09:30:00Z",
"updated_at": "2026-06-15T09:30:00Z"
}delete
/fields/{field_id}Delete a field by id
Requires an
Authorization: Bearer header.Parameters
field_idstringpathrequiredResponse 200
DELETE /fields/{field_id}
curl -X DELETE "https://api.cropsense.africa/fields/8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Example response · 200
nullpost
/fields/createCreate a field
Requires an
Authorization: Bearer header.Request body
farm_idstringrequirednamestringrequiredfield_typeenum<string>optionalField type enum
open_fieldgreenhouseforestotherfield_statusenum<string>optionalField status enum
fallowharvestedplantedploughedgeomobjectrequiredcreated_atstring<date-time>optionalupdated_atstring<date-time>optionalResponse 200
field_idstringrequiredfarm_idstringrequirednamestringrequiredfield_typeenum<string>optionalField type enum
open_fieldgreenhouseforestotherfield_statusenum<string>optionalField status enum
fallowharvestedplantedploughedlatitudenumberrequiredlongitudenumberrequiredarea_hanumberrequiredaddressstringoptionalcitystringoptionalstatestringoptionalcountrystringoptionalgeomobjectrequiredis_activebooleanrequiredcreated_atstring<date-time>requiredupdated_atstring<date-time>requiredPOST /fields/create
curl -X POST "https://api.cropsense.africa/fields/create" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
"name": "Green Valley Farm",
"field_type": "open_field",
"field_status": "fallow",
"geom": {},
"created_at": "2026-06-15T09:30:00Z",
"updated_at": "2026-06-15T09:30:00Z"
}'Example response · 200
{
"field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
"farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
"name": "Green Valley Farm",
"field_type": "open_field",
"field_status": "fallow",
"latitude": 1.5,
"longitude": 1.5,
"area_ha": 1.5,
"address": "address",
"city": "city",
"state": "state",
"country": "Kenya",
"geom": {},
"is_active": true,
"created_at": "2026-06-15T09:30:00Z",
"updated_at": "2026-06-15T09:30:00Z"
}get
/fields/farm/{farm_id}Get fields by farm id
Requires an
Authorization: Bearer header.Parameters
farm_idstringpathrequiredResponse 200
fieldsField[]requiredtotalintegerrequiredGET /fields/farm/{farm_id}
curl -X GET "https://api.cropsense.africa/fields/farm/3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Example response · 200
{
"fields": [
{
"field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
"farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
"name": "Green Valley Farm",
"field_type": "open_field",
"field_status": "fallow",
"latitude": 1.5,
"longitude": 1.5,
"area_ha": 1.5,
"address": "address",
"city": "city",
"state": "state",
"country": "Kenya",
"geom": {},
"is_active": true,
"created_at": "2026-06-15T09:30:00Z",
"updated_at": "2026-06-15T09:30:00Z"
}
],
"total": 1
}