CropSense

Search documentation

Search for a command to run...

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_idstringpathrequired

Response 200

field_idstringrequired
farm_idstringrequired
namestringrequired
field_typeenum<string>optional

Field type enum

open_fieldgreenhouseforestother
field_statusenum<string>optional

Field status enum

fallowharvestedplantedploughed
latitudenumberrequired
longitudenumberrequired
area_hanumberrequired
addressstringoptional
citystringoptional
statestringoptional
countrystringoptional
geomobjectrequired
is_activebooleanrequired
created_atstring<date-time>required
updated_atstring<date-time>required
GET /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_idstringpathrequired

Request body

namestringoptional
field_typeenum<string>optional

Field type enum

open_fieldgreenhouseforestother
field_statusenum<string>optional

Field status enum

fallowharvestedplantedploughed
geomobjectoptional
updated_atstring<date-time>optional

Response 200

field_idstringrequired
farm_idstringrequired
namestringrequired
field_typeenum<string>optional

Field type enum

open_fieldgreenhouseforestother
field_statusenum<string>optional

Field status enum

fallowharvestedplantedploughed
latitudenumberrequired
longitudenumberrequired
area_hanumberrequired
addressstringoptional
citystringoptional
statestringoptional
countrystringoptional
geomobjectrequired
is_activebooleanrequired
created_atstring<date-time>required
updated_atstring<date-time>required
PUT /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_idstringpathrequired

Response 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
null
post/fields/create

Create a field

Requires an Authorization: Bearer header.

Request body

farm_idstringrequired
namestringrequired
field_typeenum<string>optional

Field type enum

open_fieldgreenhouseforestother
field_statusenum<string>optional

Field status enum

fallowharvestedplantedploughed
geomobjectrequired
created_atstring<date-time>optional
updated_atstring<date-time>optional

Response 200

field_idstringrequired
farm_idstringrequired
namestringrequired
field_typeenum<string>optional

Field type enum

open_fieldgreenhouseforestother
field_statusenum<string>optional

Field status enum

fallowharvestedplantedploughed
latitudenumberrequired
longitudenumberrequired
area_hanumberrequired
addressstringoptional
citystringoptional
statestringoptional
countrystringoptional
geomobjectrequired
is_activebooleanrequired
created_atstring<date-time>required
updated_atstring<date-time>required
POST /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_idstringpathrequired

Response 200

fieldsField[]required
totalintegerrequired
GET /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
}