Skip to main content

Agro API (v1)

Download OpenAPI specification:Download

An API for managing your data on FarmAI

Activities

Create a new cropzone activity

Creates a activity under cropzone, requires organization write access

Authorizations:
bearerAuth
path Parameters
cropzone_id
required
string
Request Body schema: application/json
activity_type_id
string
start_date
string

Start date follows iso8601 format

end_date
string

End date follows iso8601 format

extra
object

Responses

Request samples

Content type
application/json
{
  • "activity_type_id": "5d2b6be0-f1b0-4f9f-a15c-6cdb622e2c51",
  • "start_date": "2021-05-06T12:39:36Z",
  • "end_date": "2021-07-16T10:20:11Z",
  • "extra": { }
}

Response samples

Content type
application/json
{
  • "id": "dd732456-9218-48b3-895d-7522d38e610b",
  • "owner": null,
  • "extra": { },
  • "assignees": [ ],
  • "labels": [ ],
  • "activity_type": {
    },
  • "type": "CropzoneActivity",
  • "start_date": "2021-05-06T12:39:36Z",
  • "end_date": null,
  • "attachments": [ ],
  • "note": "Test Note",
  • "cropzone_id": "7e783fe6-7158-41af-818b-27595ab7240e",
  • "cropzone": {
    },
  • "farm": {
    },
  • "field": {
    },
  • "archived_at": null,
  • "created_at": "2024-12-25T07:53:33Z",
  • "updated_at": "2024-12-25T07:53:33Z"
}

List activities of a cropzone

Get a list of activities associated with the cropzone with cropzone_id provided in url Required organizations:read scope to access

Authorizations:
bearerAuth
path Parameters
cropzone_id
required
string
query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

filter[field_id]
string <uuid>

Field ID to filter

filter[farm_id]
string <uuid>

Farm ID to filter

filter[cropzone_id]
string <uuid>

Cropzone ID to filter

filter[activity_type_id]
string <uuid>
Example: filter[activity_type_id]=1

To filter by activity_type_id

filter[start_date_from]
string <datetime>
Example: filter[start_date_from]=2022-01-01

To filter by start_date from

filter[start_date_to]
string <datetime>
Example: filter[start_date_to]=2022-01-31

To filter by start_date to

filter[end_date_from]
string or null <datetime>
Example: filter[end_date_from]=2022-01-01

To filter by end_date from

filter[end_date_to]
string or null <datetime>
Example: filter[end_date_to]=2022-01-31

To filter by end_date to

filter[status]
string or null
Example: filter[status]=all

status can be all, current, archived. All will show all activities, current the non archived, and archived only the archived activities

Request Body schema: application/json
string or null

Responses

Request samples

Content type
application/json
"string"

Response samples

Content type
application/json
Example
[
  • {
    },
  • {
    }
]

Delete an activity

Deletes activity. You must have an API token with the organizations:admin or organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

Update activity info

Update Activity info. You must have an API token with the organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string
Request Body schema: application/json
activity_type_id
required
string
start_date
required
string

Start date follows iso8601 format

end_date
string

End date follows iso8601 format

note
string
extra
object

Responses

Request samples

Content type
application/json
{
  • "activity_type_id": "65f2ee9d-d96d-462f-8fbd-03b426a582a7",
  • "start_date": "2021-05-06T12:39:36Z",
  • "end_date": "2021-07-16T10:20:11Z",
  • "note": "Test note",
  • "extra": { }
}

Response samples

Content type
application/json
{
  • "id": "81b977fd-26e8-4041-8c57-50e1da22690c",
  • "owner": null,
  • "extra": { },
  • "assignees": [ ],
  • "labels": [ ],
  • "activity_type": {
    },
  • "type": "CropzoneActivity",
  • "start_date": "2024-12-25T07:53:36Z",
  • "end_date": "2025-01-25T07:53:36Z",
  • "attachments": [ ],
  • "note": null,
  • "cropzone_id": "f8a1b29b-d5e4-44f0-81f0-1d867ebda668",
  • "cropzone": {
    },
  • "farm": {
    },
  • "field": {
    },
  • "archived_at": null,
  • "created_at": "2024-12-25T07:53:36Z",
  • "updated_at": "2024-12-25T07:53:36Z"
}

activity info

Get activity info

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "e0f6c3d6-1a83-4024-ae68-c1f558e938a2",
  • "owner": null,
  • "extra": { },
  • "assignees": [ ],
  • "labels": [ ],
  • "activity_type": {
    },
  • "type": "CropzoneActivity",
  • "start_date": "2024-12-25T07:53:42Z",
  • "end_date": "2024-12-26T07:53:42Z",
  • "attachments": [ ],
  • "note": null,
  • "cropzone_id": "68f231ea-aeb5-4e83-aa0e-610306159d24",
  • "cropzone": {
    },
  • "farm": {
    },
  • "field": {
    },
  • "archived_at": null,
  • "created_at": "2024-12-25T07:53:42Z",
  • "updated_at": "2024-12-25T07:53:42Z"
}

Archive an activity

Archives activity. You must have an API token with the organizations:admin or organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

Unarchive an archived activity

Unarchive an archived activity. You must have an API token with the organizations:admin or organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

List activities of a farm

Get a list of activities associated with the farm with farm_id provided in urlRequired organizations:read scope to access

Authorizations:
bearerAuth
path Parameters
farm_id
required
string
query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

status
string
Example: status=all

status can be all, current, archived. All will show all activities, current the non archived, and archived only the archived activities

Responses

Response samples

Content type
application/json
Example
[
  • {
    },
  • {
    }
]

List activities of a field

Get a list of activities associated with the field with field_id provided in urlRequired organizations:read scope to access

Authorizations:
bearerAuth
path Parameters
field_id
required
string
query Parameters
page
integer
Default: 1

Page number

activity_type_id
string

To filter by activity_type_id

from
string

To filter by start_date or end_date from

to
string

To filter by start_date or end_date to

status
string
Example: status=all

status can be all, current, archived. All will show all activities, current the non archived, and archived only the archived activities

Responses

Response samples

Content type
application/json
Example
[
  • {
    },
  • {
    }
]

ActivityType

List of activity types

Get a list of all activity types added in the system.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Attachments

Delete an attachment

Deletes an attachment. You must have an API token with the organizations:admin or organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

Crops

List of crops

Get a list of all crops added in the system

Authorizations:
bearerAuth
query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

filter[query]
string
Example: filter[query]=banana

Search crops by query

filter[lang]
string
Enum: "th" "en" "ja" "vi"
Example: filter[lang]=th

User language (used for searching)

Responses

Response samples

Content type
application/json
Example
[
  • {
    },
  • {
    },
  • {
    }
]

Cropzones

Create a new cropzone

Creates a cropzone under field,
requires organizations:write scope

Authorizations:
bearerAuth
path Parameters
field_id
required
string
Request Body schema: application/json
name
string

Cropzone name

crop_id
string
note
string

Note for a field, limits to 140 characters only.

prev_cropzone_id
string

Previous cropzone ID for history linking

generation
number

Generation. For crops like sugarcane

planting_date
string

Planting date follows iso8601 format

object (Polygon)

GeoJSon geometry

Responses

Request samples

Content type
application/json
{
  • "name": "Cropzone name",
  • "crop_id": "c2a55fb8-c80c-4d17-9d6c-aff094d6d38b",
  • "note": "note for a cropzone",
  • "prev_cropzone_id": "982499fd-a09c-4bea-b7bf-1e905007138c",
  • "generation": 1,
  • "planting_date": "2021-04-29T11:36:00Z",
  • "location": {
    }
}

Response samples

Content type
application/json
Example
{
  • "id": "217cfecf-e4ed-4a10-bb0f-b6b82a560d8d",
  • "slug": "sparkling-wildflower-83",
  • "name": "X search Test X",
  • "area": 573,
  • "area_unit": "m2",
  • "note": "this is a cropzone note",
  • "labels": [ ],
  • "timezone": "UTC",
  • "location": {
    },
  • "start_date": "2021-04-29T11:36:00Z",
  • "end_date": null,
  • "planting_date": "2021-04-29T11:36:00Z",
  • "dap": 1336,
  • "crop": {
    },
  • "field_id": "50c3d8a8-2b5b-49b2-92de-4edb1c33117f",
  • "field": {
    },
  • "farm": {
    },
  • "season": null,
  • "activities_count": 1,
  • "soil_samples_count": 0,
  • "preview_uri": null,
  • "predicted": {
    },
  • "generation": 2,
  • "next_cropzone": null,
  • "prev_cropzone": {
    },
  • "rs_stopped_at": null,
  • "archived_at": null,
  • "created_at": "2024-12-25T07:54:17Z",
  • "updated_at": "2024-12-25T07:54:17Z",
  • "latest_vis": [ ]
}

List of cropzones related to a field

    Get a list of all cropzones associated with the field with `field_id` provided in url
    Required `organizations:read` scope to access
Authorizations:
bearerAuth
path Parameters
field_id
required
string
query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

filter[status]
string
Example: filter[status]=all

status can be all, current, archived. All will show all cropzones, current the non archived, and archived only the archived cropzones

filter[query]
string
Example: filter[query]=searchTerm

Searches cropzone by cropzone name or crop name (ignoring case)

Responses

Response samples

Content type
application/json
Example
[
  • {
    },
  • {
    }
]

Delete a cropzone

Delete cropzones. You must have an API token with the organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

Update cropzone information

Update Cropzone info. You must have an API token with the organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string
Request Body schema: application/json
name
string

Cropzone name

crop_id
string
note
string

Note for a field, limits to 140 characters only.

prev_cropzone_id
string

Previous cropzone ID for history linking

generation
number

Generation. For crops like sugarcane

planting_date
string

Planting date follows iso8601 format

object (Polygon)

GeoJSon geometry

Responses

Request samples

Content type
application/json
{
  • "name": "Cropzone name",
  • "crop_id": "c2a55fb8-c80c-4d17-9d6c-aff094d6d38b",
  • "note": "note for a cropzone",
  • "prev_cropzone_id": "982499fd-a09c-4bea-b7bf-1e905007138c",
  • "generation": 1,
  • "planting_date": "2021-04-29T11:36:00Z",
  • "location": {
    }
}

Response samples

Content type
application/json
Example
{
  • "id": "917e38b4-be5f-4b08-a388-5c35c9afb342",
  • "slug": "crimson-sound-24",
  • "name": "cropzone 257625848",
  • "area": 199,
  • "area_unit": "m2",
  • "note": "42",
  • "labels": [ ],
  • "timezone": "UTC",
  • "location": {
    },
  • "start_date": "2022-04-10T17:00:00Z",
  • "end_date": "2022-07-02T17:00:00Z",
  • "planting_date": "2022-04-10T17:00:00Z",
  • "dap": 990,
  • "crop": {
    },
  • "field_id": "558c8145-3b80-4b5f-bb3d-a4f7dcfeec12",
  • "field": {
    },
  • "farm": {
    },
  • "season": null,
  • "activities_count": 2,
  • "soil_samples_count": 0,
  • "preview_uri": null,
  • "predicted": {
    },
  • "generation": 0,
  • "next_cropzone": null,
  • "prev_cropzone": null,
  • "rs_stopped_at": null,
  • "archived_at": null,
  • "created_at": "2024-12-25T07:54:20Z",
  • "updated_at": "2024-12-25T07:54:21Z",
  • "latest_vis": [ ],
  • "actual": {
    }
}

Cropzone info

Get cropzone info

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
Example
{
  • "id": "6dc2c636-000c-4180-badf-c23b6a889005",
  • "slug": "snowy-cloud-58",
  • "name": "cropzone 936421791",
  • "area": 199,
  • "area_unit": "m2",
  • "note": "note for cropzone",
  • "labels": [ ],
  • "timezone": "UTC",
  • "location": {
    },
  • "start_date": "2024-12-25T07:54:38Z",
  • "end_date": null,
  • "planting_date": null,
  • "dap": null,
  • "crop": {
    },
  • "field_id": "f76d7201-5368-401b-851e-50323dd87994",
  • "field": {
    },
  • "farm": {
    },
  • "season": null,
  • "activities_count": null,
  • "soil_samples_count": 0,
  • "preview_uri": null,
  • "predicted": {
    },
  • "generation": 0,
  • "next_cropzone": null,
  • "prev_cropzone": null,
  • "rs_stopped_at": null,
  • "archived_at": null,
  • "created_at": "2024-12-25T07:54:38Z",
  • "updated_at": "2024-12-25T07:54:38Z",
  • "latest_vis": [ ]
}

Archive a cropzone

Archive cropzones. You must have an API token with the organizations:admin or organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

Renew a cropzone for a new season

Renew a cropzone for a new season. Copies all attributes of current cropzone into a new one for the next season. You must have an API token with the organizations:admin or organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "464703a2-d938-4fae-b7b1-f445ec01e078",
  • "slug": "late-leaf-70",
  • "name": "cropzone 184924330",
  • "area": 199,
  • "area_unit": "m2",
  • "note": null,
  • "labels": [ ],
  • "timezone": "UTC",
  • "location": {
    },
  • "start_date": "2024-12-25T07:54:20Z",
  • "end_date": null,
  • "planting_date": null,
  • "dap": null,
  • "crop": {
    },
  • "field_id": "b10b7037-276a-414f-8458-dc93c8ef8385",
  • "field": {
    },
  • "farm": {
    },
  • "season": null,
  • "activities_count": null,
  • "soil_samples_count": 0,
  • "preview_uri": null,
  • "predicted": {
    },
  • "generation": 1,
  • "next_cropzone": null,
  • "prev_cropzone": {
    },
  • "rs_stopped_at": null,
  • "archived_at": null,
  • "created_at": "2024-12-25T07:54:20Z",
  • "updated_at": "2024-12-25T07:54:20Z",
  • "latest_vis": [ ]
}

Unarchive an archived cropzone

Unarchive an archived cropzone. You must have an API token with the organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

List of cropzones related to an organization

Get a list of all cropzones associated with the organization with organization_id provided in urlRequired organizations:read scope to access

Authorizations:
bearerAuth
path Parameters
organization_id
required
string
query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

boundary
string

Boundary array with two points to get cropzones within the box created by these two points, returns groups array if size >= 200

distance
string

Used in conjunction with boundary parameter. Distance in meters between fields to consider them grouped.

z
string

Used in conjunction with boundary and distance parameter. Zoom level from 0 to 20. Default 0. If the level is < 13 you always get groups.

status
string
Example: status=all

status can be all, current, archived. All will show all cropzones, current the non archived, and archived only the archived cropzones

field_id
string
Example: field_id=6d64031e-fc77-41a5-8c58-9e73faf6d02e

Filter cropzones by field_id

sort_by
string

Can be one of name_asc,name_desc,farm_asc,farm_desc,crop_asc,crop_desc,slug_asc,slug_desc,created_at_asc,created_at_desc,maturity_date_predicted_asc,maturity_date_predicted_desc,planting_date_asc,planting_date_desc,dap_asc,dap_desc,harvest_date_asc,harvest_date_desc,production_predicted_asc,production_predicted_desc,production_actual_asc,production_actual_desc,yield_predicted_asc,yield_predicted_desc,yield_actual_asc,yield_actual_desc,predicted_ccs_asc,predicted_ccs_desc,crop_quality_asc,crop_quality_desc,harvest_destination_asc,harvest_destination_desc,income_asc,income_desc,distance. If sort_by=distance then you also need to provide location=lng,lat , which is the location to show the distance from

location
string
Example: location=128.1288242340088,36.864428996284325

lng,lat. Location of the origin point for the sort_by=distance sorting

include
string

Comma separated list of related required objects in the response

filter[crop_id]
string
Example: filter[crop_id]=6d64031e-fc77-41a5-8c58-9e73faf6d02e

Filter cropzones by crop_id

filter[season_id]
string
Example: filter[season_id]=6d64031e-fc77-41a5-8c58-9e73faf6d02e

Filter cropzones by season_id

filter[query]
string
Example: filter[query]=searchTerm

Searches cropzone by cropzone name or crop name (ignoring case)

filter[status]
string
Example: filter[status]=all

status can be all, current, archived. All will show all cropzones, current the non archived, and archived only the archived cropzones

filter[labels][]
Array of arrays

Filter by labels

filter[start_date_from]
string
Example: filter[start_date_from]=2022-11-22T16:18:23+09:00

Filter by start date from

filter[start_date_to]
string
Example: filter[start_date_to]=2022-11-22T16:18:23+09:00

Filter by start date to

filter[end_date_from]
string
Example: filter[end_date_from]=2022-11-22T16:18:23+09:00

Filter by end date from

filter[end_date_to]
string
Example: filter[end_date_to]=2022-11-22T16:18:23+09:00

Filter by end date to

filter[farm_id]
string
Example: filter[farm_id]=0803d415-e933-476a-96fe-4607e47fecd0

Filter by farm_id

Responses

Response samples

Content type
application/json
Example
[
  • {
    }
]

List of cropzones related to an organization in geojson format

          Get a list of all cropzones associated with the organization with `organization_id` provided in url.
          Body parameters are the same as /organizations/{organization_id}/cropzones. Only response format changes (geojson)
Authorizations:
bearerAuth
path Parameters
organization_id
required
string
query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

Responses

Response samples

Content type
application/json
{
  • "type": "FeatureCollection",
  • "crs": {
    },
  • "features": [
    ]
}

Farms

Create a new farm

Create a new farm for your user. You must have an API token with the organizations:write scope (farms are organizations).

Authorizations:
bearerAuth
Request Body schema: application/json
name
required
string
phone
string or null
address
string or null

Responses

Request samples

Content type
application/json
{
  • "name": "Listenfield",
  • "phone": "+50712264117793",
  • "address": "9756 Gutkowski Inlet"
}

Response samples

Content type
application/json
{
  • "id": "c9c7d835-d6d9-4889-b39a-d1193a17dd4a",
  • "name": "test1",
  • "email": null,
  • "address": "Tokyo-to Shinjuku-Ku Okubo",
  • "phone": "+819012121212",
  • "description": null,
  • "location": null,
  • "preview_uri": null,
  • "slug": "billowing-snowflake-0",
  • "features": {
    },
  • "prod_targets": { },
  • "created_at": "2024-12-25T07:54:38Z",
  • "updated_at": "2024-12-25T07:54:38Z"
}

Get the list of farms

Get list of Farms associated to current token owner. You must have an API token with the organizations:read scope (farms are organizations).

Authorizations:
bearerAuth
query Parameters
page
integer
Default: 1

Page number

Responses

Response samples

Content type
application/json
[
  • {
    }
]

farm info

Get farm info

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "580d26e3-2085-451a-bd53-5987ac0b5cc1",
  • "name": "Mraz, Mills and Blick",
  • "email": "wm.mueller@kautzer.io",
  • "address": null,
  • "phone": null,
  • "description": null,
  • "location": null,
  • "preview_uri": null,
  • "slug": "sparkling-sky-82",
  • "features": {
    },
  • "prod_targets": { },
  • "created_at": "2024-12-25T07:54:39Z",
  • "updated_at": "2024-12-25T07:54:39Z",
  • "stats": {
    }
}

Create a new farm in Organization

Create Farms. You must have an API token with the organizations:write scope.

Authorizations:
bearerAuth
path Parameters
organization_id
required
string
Request Body schema: application/json
name
required
string
phone
string
address
string

Responses

Request samples

Content type
application/json
{
  • "name": "Listenfield",
  • "phone": "+819012121212",
  • "address": "Tokyo-to Shinjuku-Ku Okubo 1-1-1"
}

Response samples

Content type
application/json
{
  • "id": "17833560-822c-4f58-9734-788c040b40b0",
  • "name": "test1",
  • "email": null,
  • "address": "Tokyo-to Shinjuku-Ku Okubo",
  • "phone": "+819014141414",
  • "description": null,
  • "location": null,
  • "preview_uri": null,
  • "slug": "holy-star-63",
  • "features": {
    },
  • "prod_targets": { },
  • "created_at": "2024-12-25T07:54:40Z",
  • "updated_at": "2024-12-25T07:54:40Z"
}

Get farms of an Organization

Get the farms of an Organization

Authorizations:
bearerAuth
path Parameters
organization_id
required
string
query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

filter[query]
string

Searches farms by farm name (ignoring case)

Request Body schema: application/json
string

Responses

Request samples

Content type
application/json
"string"

Response samples

Content type
application/json
[
  • {
    }
]

Fields

Create a new field

Creates a field under farm,
requires organization write access

Authorizations:
bearerAuth
path Parameters
farm_id
required
string
Request Body schema: application/json
name
string or null

Name of field

note
string or null

Note for a field, limits to 140 chars

required
object

Responses

Request samples

Content type
application/json
{
  • "name": "Listenfield field",
  • "note": "Note for field",
  • "location": {
    }
}

Response samples

Content type
application/json
{
  • "id": "ece8a407-586d-450d-98bc-f3e9356b40cc",
  • "farm_id": "6187bceb-7af5-411e-8304-3c8c4350458b",
  • "name": "field name",
  • "area": 573,
  • "area_unit": "m2",
  • "note": null,
  • "timezone": "UTC",
  • "location": {
    },
  • "crops_summary": [ ],
  • "preview_uri": null,
  • "archived_at": null,
  • "created_at": "2024-12-25T07:54:40Z",
  • "updated_at": "2024-12-25T07:54:40Z"
}

List of fields

Get a list of all fields associated with the farm with farm_id provided in urlRequired organizations:read scope to access

Authorizations:
bearerAuth
path Parameters
farm_id
required
string
query Parameters
status
string
Example: status=all

status can be all, current, archived. All will show all fields, current the non archived, and archived only the archived fields

archived
string
Example: archived=true

(DEPRECATED use status) adding archived=true in the query will return all archived fields

unfiltered
string
Example: unfiltered=unfiltered

(DEPRECATED use status) adding unfiltered in the query will return all archived and unarchived fields

query
string
Example: query=searchTerm

Only returns fields matching the search term (in name or note fields)

page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

Responses

Response samples

Content type
application/json
Example
[
  • {
    },
  • {
    }
]

Delete a field

Delete Fields. You must have an API token with organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

field info

Get field info

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
Example
{
  • "id": "6d8a439a-49cc-4aee-95c5-0ed8c62bc880",
  • "farm_id": "42155355-07a3-4962-b1a9-4fc91e90f2d9",
  • "name": "field 343597423",
  • "area": 199,
  • "area_unit": "m2",
  • "note": "note for field",
  • "timezone": "UTC",
  • "location": {
    },
  • "crops_summary": [ ],
  • "preview_uri": null,
  • "archived_at": null,
  • "created_at": "2024-12-25T07:54:44Z",
  • "updated_at": "2024-12-25T07:54:44Z",
  • "farm": {
    }
}

Archive a field

Archive Fields. You must have an API token with organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

Unarchive an archived field

Unarchive an archived field. You must have an API token with the organizations:admin or organizations:write scope.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

Get fields of an Organization

Get the fields of an Organization

Authorizations:
bearerAuth
path Parameters
organization_id
required
string
query Parameters
boundary
string

Boundary array with two points to get fields within the box created by these two points, returns groups array if size >= 50

distance
string

Used in conjunction with boundary parameter. Distance in meters between fields to consider them grouped.

page
integer
Default: 1

Page Integer

farm_id
string
Example: farm_id=1d590f61-e940-488d-884d-7de3cc7e6d18

Only returns fields from the specified farm

Responses

Response samples

Content type
application/json
Example
[
  • {
    }
]

Get fields of an Organization in geojson format

Get the fields of an Organization in geojson format

Authorizations:
bearerAuth
path Parameters
organization_id
required
string
query Parameters
boundary
string

Boundary array with two points to get fields within the box created by these two points, returns groups array if size >= 50

page
integer
Default: 1

Page Integer

Responses

Response samples

Content type
application/json
{
  • "type": "FeatureCollection",
  • "crs": {
    },
  • "features": [
    ]
}

Organizations

List organizations

List Organizations the token belongs to.

Authorizations:
bearerAuth
query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Organization info

Get Organization info. Is is possible to access very basic information (name) of an organization you are not part of.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
Example
{
  • "id": "be72e712-6f97-442e-8c7b-45b01ed88502",
  • "name": "West-Doyle",
  • "email": "ara@casper-conn.biz",
  • "address": null,
  • "phone": null,
  • "description": null,
  • "location": null,
  • "preview_uri": null,
  • "slug": "summer-glitter-69",
  • "features": {
    },
  • "prod_targets": { },
  • "created_at": "2024-12-25T07:55:14Z",
  • "updated_at": "2024-12-25T07:55:14Z",
  • "crop_summary": [
    ],
  • "stats": {
    }
}

Update Organization info

Update Organizations info.

Authorizations:
bearerAuth
path Parameters
id
required
string
Request Body schema: application/json
name
string
email
string
phone
string
address
string
object
object

Responses

Request samples

Content type
application/json
{
  • "name": "Listenfield",
  • "email": "info@listenfield.com",
  • "phone": "+819012121212",
  • "address": "Tokyo-to Shinjuku-Ku Okubo 1-1-1",
  • "location": {
    },
  • "prod_targets": {
    }
}

Response samples

Content type
application/json
{
  • "id": "c22e9a4b-80ba-4539-9c92-c8e89288dd22",
  • "name": "Nolan Group",
  • "email": "felicia@durgan.net",
  • "address": "3953 Koepp River",
  • "phone": "577-485-6590",
  • "description": "Ut qui non molestiae.",
  • "location": null,
  • "preview_uri": null,
  • "slug": "late-cloud-63",
  • "features": {
    },
  • "prod_targets": {
    },
  • "created_at": "2024-12-25T07:55:18Z",
  • "updated_at": "2024-12-25T07:55:18Z"
}

List of unique regions where organization fields are located

List of unique regions where organization fields are located

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "France": [
    ],
  • "Thailand": [
    ]
}

List of unique countries where organization fields are located

List of unique countries where organization fields are located

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
[
  • "France",
  • "Japan",
  • "Thailand"
]

Places

List all the places of an organization

Get all the places in the system

Authorizations:
bearerAuth
path Parameters
organization_id
required
string

Organization UUID

query Parameters
page
integer
Default: 1

Page number

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Create a new place

Create a new place

Authorizations:
bearerAuth
path Parameters
organization_id
required
string

Organization UUID

Request Body schema: application/json
name
required
string
phone
string
description
string
city
string
address
string
location
Array of arrays

Array of longitude, latitude

Responses

Request samples

Content type
application/json
{
  • "name": "ABC Factory",
  • "phone": "+819012121212",
  • "description": "Example of description of goods",
  • "city": "Bangkok",
  • "address": "7 Prompong Road, Bangkok 10110",
  • "location": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "c217a93c-b0fd-493f-93ae-4b8128531c16",
  • "name": "Test Factory",
  • "description": "Test description",
  • "phone": "+819012121212",
  • "city": "Hanoi",
  • "address": "18, Minh Street",
  • "lnglat": {
    },
  • "created_at": "2024-12-25T07:55:21Z",
  • "updated_at": "2024-12-25T07:55:21Z"
}

Updates a place

Update a place.

Authorizations:
bearerAuth
path Parameters
id
required
string
Request Body schema: application/json
name
string
phone
string
city
string
address
string
location
Array of arrays

Array of longitude, latitude

Responses

Request samples

Content type
application/json
{
  • "name": "ABC Factory",
  • "phone": "+819012121212",
  • "city": "Bangkok",
  • "address": "7, Prompong Road",
  • "location": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "ba151cd3-587b-40ca-b1e0-9147849124d3",
  • "name": "New name",
  • "description": "Example of description of goods",
  • "phone": "+819012121212",
  • "city": "Bangkok",
  • "address": "7, Prampong Road",
  • "lnglat": {
    },
  • "created_at": "2024-12-25T07:55:21Z",
  • "updated_at": "2024-12-25T07:55:21Z"
}

Get a place

Get a place information.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "d9c9a3c3-2420-4a1d-960e-27a61c424663",
  • "name": "Lueilwitz-Lowe",
  • "description": "Example of description of goods",
  • "phone": "+819012121212",
  • "city": "Bangkok",
  • "address": "7, Prampong Road",
  • "lnglat": {
    },
  • "created_at": "2024-12-25T07:55:22Z",
  • "updated_at": "2024-12-25T07:55:22Z"
}

QR

Get QR codes of all farms of an organization

Get all organization's farms QR codes at once.

Authorizations:
bearerAuth
path Parameters
organization_id
required
string

Organization UUID

query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

Responses

Get QR code of specified farm

Get QR code of specified farm. The QR code is returned as SVG and is signed and gzipped. You can verify it later with the /qr/verify endpoint

Authorizations:
bearerAuth
path Parameters
organization_id
required
string

Organization UUID

farm_id
required
string

Farm UUID

Responses

Get QR code of specified farm

Get QR code of specified farm. The QR code is returned as SVG and is signed and gzipped. You can verify it later with the /qr/verify endpoint

Authorizations:
bearerAuth
path Parameters
farm_id
required
string

Farm UUID

Responses

Get QR code of specified farm as PNG

Get QR code of specified farm. The QR code is returned as PNG and is signed and gzipped. You can verify it later with the /qr/verify endpoint

Authorizations:
bearerAuth
path Parameters
farm_id
required
string

Farm UUID

Responses

Verify signature of FarmAI QR code.

Verify signature of FarmAI QR code. And process it (i.e join farm)

Authorizations:
bearerAuth
Request Body schema: application/json
payload
required
string

Responses

Request samples

Content type
application/json
{
  • "payload": "string"
}

Sensor

Insert new measurements

Insert new measurements for a sensor

Authorizations:
bearerAuth
path Parameters
sensor_id
required
string

Sensor UUID

Request Body schema: application/json
Array
data
object

data json for the measurement

read_at
string

read_at follows iso8601 format

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "units": {
    },
  • "measurements": [
    ]
}

List of measurements

Get a list of all measurements associated with the sensor with sensor_id provided in url Required iot:read scope to access

Authorizations:
bearerAuth
path Parameters
sensor_id
required
string
query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

from
string

To filter by read_at datetime from (ISO8601)

to
string

To filter by read_at datetime to (ISO8601)

Responses

Response samples

Content type
application/json
Example
{
  • "units": {
    },
  • "measurements": [
    ]
}

Update measurement info

Updates measurement info. You must have an API token with iot:write scope in order to use this.

Authorizations:
bearerAuth
path Parameters
id
required
string
Request Body schema: application/json
data
object

data json for the measurement

read_at
string

read_at follows iso8601 format

Responses

Request samples

Content type
application/json
{
  • "data": {
    },
  • "read_at": "2021-07-16T10:20:11+00:00"
}

Response samples

Content type
application/json
{
  • "units": {
    },
  • "measurements": [
    ]
}

measurement info

Get measurement info

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "units": {
    },
  • "measurements": [
    ]
}

Create a new sensor

Creates a new sensor under organization

Authorizations:
bearerAuth
path Parameters
organization_id
required
string

Organization/Farm UUID

Request Body schema: application/json
name
required
string
kind
string
location
Array of numbers <float> [ items <float > ]

[lng,lat] of location

metadata
object or null
units
object or null

Responses

Request samples

Content type
application/json
{
  • "name": "Temperature Sensor",
  • "kind": "weather_station",
  • "location": [
    ],
  • "metadata": { },
  • "units": {
    }
}

Response samples

Content type
application/json
{
  • "id": "ce1be4be-6a6b-430a-a775-339ed61d83b9",
  • "name": "Farm - A - solid sensor",
  • "kind": "weather_station",
  • "location": {
    },
  • "units": {
    },
  • "metadata": {
    },
  • "created_at": "2024-12-25T07:55:28Z",
  • "updated_at": "2024-12-25T07:55:28Z"
}

List of sensors

Get a list of all sensors associated with the organization with organization_id provided in urlRequired iot:read scope to access

Authorizations:
bearerAuth
path Parameters
organization_id
required
string
query Parameters
page
integer
Default: 1

Page Integer

lat
string
lng
string

Responses

Response samples

Content type
application/json
Example
[
  • {
    },
  • {
    },
  • {
    }
]

Update sensor info

Update Sensor info. You must have an API token with iot:write scope in order to use this.

Authorizations:
bearerAuth
path Parameters
id
required
string
Request Body schema: application/json
name
string
kind
string

Value from

location
Array of arrays

array of lng, lat

units
object

units hash

metadata
object

metadata of the sensor

Responses

Request samples

Content type
application/json
{
  • "name": "farm abc - soil - installed",
  • "kind": "weather_station",
  • "location": [
    ],
  • "units": {
    },
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "id": "325f14d4-293d-4861-9c9f-9c1ce21339e9",
  • "name": "Expected name for sensor",
  • "kind": "weather_station",
  • "location": {
    },
  • "units": {
    },
  • "metadata": { },
  • "created_at": "2024-12-25T07:55:29Z",
  • "updated_at": "2024-12-25T07:55:29Z",
  • "organization": {
    }
}

sensor info

Get sensor info

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "cfc917fd-e195-410c-a565-5d8ae3dec727",
  • "name": "Ceiling fan",
  • "kind": "weather_station",
  • "location": {
    },
  • "units": {
    },
  • "metadata": { },
  • "created_at": "2024-12-25T07:55:29Z",
  • "updated_at": "2024-12-25T07:55:29Z",
  • "organization": {
    }
}

SoilSamples

List all the soil samples of a cropzone

List all the soil samples of a cropzone

Authorizations:
bearerAuth
path Parameters
cropzone_id
required
string

Cropzone UUID

query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List all the soil samples of an organization

List all the soil samples of an Organization

Authorizations:
bearerAuth
path Parameters
organization_id
required
string

Organization UUID

query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a soil sample result

Get a soil sample result.

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "03d45c58-6618-40dc-a568-30a9f5ae4a23",
  • "cropzone_id": "02212841-de7d-4ed6-86a3-acb513498a4f",
  • "cropzone": {
    },
  • "location": [
    ],
  • "results": {
    },
  • "sampled_at": "2022-12-19T12:00:00Z",
  • "created_at": "2024-12-25T07:55:30Z",
  • "updated_at": "2024-12-25T07:55:30Z",
  • "deprecated": [
    ]
}

Tokens

Revoke a token

Authorizations:
bearerAuth
path Parameters
token_id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

Get a short lived access token from your refresh token

Get a short live access token (21600 seconds) from your refresh token. At the moment grant_type MUST be client_credentials.

Authorizations:
bearerAuth
Request Body schema: application/json
grant_type
required
string
client_id
required
string

Your token client_id

client_secret
required
string

Your client secret (refresh token)

scopes
Array of strings

Responses

Request samples

Content type
application/json
{
  • "grant_type": "client_credentials",
  • "client_id": "42885717-bee2-423e-8093-71538575a42e",
  • "client_secret": "2nx4mA54RoQEh9h1SrTUpBgfjR8pXTXYvvFV",
  • "scopes": [
    ]
}

Response samples

Content type
application/json
{
  • "access_token": "6axMTrTu3pbbzWvHTBtp1Tr9Mi4JaJxGBYHV",
  • "token_type": "Bearer",
  • "expires_in": 21600,
  • "created_at": 1735113331
}

Revoke the currently used token

Revoke the token currently in used in the request. Can be used for logging out.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

Transactions

List all the Transactions of a cropzone

List all the transactions (Traceability, movements of goods) in a cropzone.

Authorizations:
bearerAuth
path Parameters
cropzone_id
required
string

Cropzone UUID

query Parameters
page
integer
Default: 1

Page number

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new Transaction

Create a new Transaction.

Authorizations:
bearerAuth
path Parameters
cropzone_id
required
string

Cropzone UUID

Request Body schema: application/json
source_id
string

UUID of source Place object. Can be nil (farm will be considered source)

destination_id
required
string

UUID of a Place object

datetime
required
string

Date and time of exchange in iso8601

qty_exchanged
required
number

Amount exchanged, in tons

object

Responses

Request samples

Content type
application/json
{
  • "source_id": "0e3f4387-25e2-4234-aaab-75bde6847c0c",
  • "destination_id": "0e3f4387-25e2-4234-aaab-75bde6847c0c",
  • "datetime": "2022-07-11T18:04:18+09:00",
  • "qty_exchanged": 42,
  • "extra": {
    }
}

Response samples

Content type
application/json
{
  • "id": "bc77139f-bc6a-4d86-bb5f-3e6fab2c8f9a",
  • "cropzone_id": "86eec109-a8d9-4253-8ad4-beb190d8efab",
  • "source": null,
  • "destination": {
    },
  • "date": "2021-01-01",
  • "datetime": "2021-01-01T00:00:00Z",
  • "qty_exchanged": "42.0",
  • "qty_exchanged_unit": "t",
  • "extra": {
    }
}

Updates a Transaction information

Updates a Transaction information

Authorizations:
bearerAuth
path Parameters
id
required
string

Tx UUID

Request Body schema: application/json
source_id
string

UUID of source Place object. Can be nil (farm will be considered source)

destination_id
string

UUID of a Place object

datetime
string

Date and time of exchange in iso8601

qty_exchanged
number

Amount exchanged, in tons

object

Responses

Request samples

Content type
application/json
{
  • "source_id": "0e3f4387-25e2-4234-aaab-75bde6847c0c",
  • "destination_id": "0e3f4387-25e2-4234-aaab-75bde6847c0c",
  • "datetime": "2022-07-11T18:04:18+09:00",
  • "qty_exchanged": 42,
  • "extra": {
    }
}

Response samples

Content type
application/json
{
  • "id": "45b20db6-3578-4134-8d24-b1e9655d574e",
  • "cropzone_id": "85f093c1-cba6-4a5e-9d77-9a6e8402f5f2",
  • "source": null,
  • "destination": {
    },
  • "date": "2021-01-02",
  • "datetime": "2021-01-02T00:00:00Z",
  • "qty_exchanged": "12.0",
  • "qty_exchanged_unit": "t",
  • "extra": {
    }
}

Delete a Transaction

Deletes a Transaction

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "success"
}

Users

Authenticate user login

Authenticates a user. You must have an API token with the users:read scope. You can also provide a firebase JWT token.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
Example
{
  • "id": "fedb0e23-58c9-4b56-bc40-b84c60b7ec72",
  • "name": "Moore and Sons",
  • "phone": "+9942581957895",
  • "email": "cris_wilkinson@labadie-waelchi.co",
  • "lang": "en",
  • "area_unit": "rai",
  • "weight_unit": "ton",
  • "soil_units": { },
  • "slug": "thrumming-sea-1",
  • "created_at": "2024-12-25T07:55:32Z",
  • "updated_at": "2024-12-25T07:55:32Z",
  • "token": {
    }
}

Update user info whose token is provided in the request

Update User info. You must have an API token with the users:admin or users:write scope in order to use this.

Authorizations:
bearerAuth
Request Body schema: application/json
name
string
email
string
phone
string
lang
string

Allowed values are [en, th, vi, jp], defaults to en

area_unit
string

Allowed values are [m2, rai, ha], defaults to m2

soil_units
object

Mapping of soil type (AgroCare codename) to units.

fcm_registration_id
string

Registration id of the client device which will be used by Firebase cloud messaging to send notifications

Responses

Request samples

Content type
application/json
{
  • "name": "John Doe",
  • "email": "contact@me.com",
  • "phone": "9822341234",
  • "lang": "en",
  • "area_unit": "rai",
  • "soil_units": {
    },
  • "fcm_registration_id": "dAlDYuaPXes:APA91bFEipx"
}

Response samples

Content type
application/json
{
  • "id": "71c28d98-fe4f-4b9b-8f16-c7b80a7b31f5",
  • "name": "edited name",
  • "phone": "+451004037123",
  • "email": "twyla.greenfelder@metz-wisozk.info",
  • "lang": "th",
  • "area_unit": "ha",
  • "weight_unit": "ton",
  • "soil_units": {
    },
  • "slug": "still-field-75",
  • "created_at": "2024-12-25T07:55:33Z",
  • "updated_at": "2024-12-25T07:55:33Z"
}

User info based on user token

Get user info

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "id": "980a0369-7cfe-4be2-9511-f2809afdcbc3",
  • "name": "Mills, Kirlin and Cummerata",
  • "phone": "+24719308657029",
  • "email": "jasper@haley-padberg.name",
  • "lang": "en",
  • "area_unit": "rai",
  • "weight_unit": "ton",
  • "soil_units": { },
  • "slug": "nameless-frog-83",
  • "created_at": "2024-12-25T07:55:33Z",
  • "updated_at": "2024-12-25T07:55:33Z"
}

Ndvi

List available Ndvi for a cropzone

List cropzone Ndvis. You must have an API token with the vi:read scope

Authorizations:
bearerAuth
path Parameters
cropzone_id
required
string
Default: "341ddacd-2ad5-40d2-9ffe-035b0a038840"

Cropzone Id

query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

from
string <datetime>

From date in ISO8601

to
string <datetime>

To date in ISO8601

source
string

Source of image (sentinel_2A or PLANET)

Request Body schema: application/json
integer

Responses

Request samples

Content type
application/json
0
0

Response samples

Content type
application/json
[
  • {
    }
]

Ndmi

List available Ndmi for a cropzone

List cropzone Ndmis. You must have an API token with the vi:read scope

Authorizations:
bearerAuth
path Parameters
cropzone_id
required
string
Default: "8605761e-5701-492f-8ccc-6c8a4b4f19a7"

Cropzone Id

query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

from
string <datetime>

From date in ISO8601

to
string <datetime>

To date in ISO8601

source
string

Source of image (sentinel_2A or PLANET)

Request Body schema: application/json
integer

Responses

Request samples

Content type
application/json
0
0

Response samples

Content type
application/json
[
  • {
    }
]

Evi

List available Evi for a cropzone

List cropzone Evis. You must have an API token with the vi:read scope

Authorizations:
bearerAuth
path Parameters
cropzone_id
required
string
Default: "c36ace92-4746-4387-b105-5c0b13895c8f"

Cropzone Id

query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

from
string <datetime>

From date in ISO8601

to
string <datetime>

To date in ISO8601

source
string

Source of image (sentinel_2A or PLANET)

Request Body schema: application/json
integer

Responses

Request samples

Content type
application/json
0
0

Response samples

Content type
application/json
[
  • {
    }
]

S2multi

List available S2multi for a cropzone

List cropzone S2multis. You must have an API token with the vi:read scope

Authorizations:
bearerAuth
path Parameters
cropzone_id
required
string
Default: "e3b4c2b4-30ed-4568-b980-9bc47e19abb7"

Cropzone Id

query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

from
string <datetime>

From date in ISO8601

to
string <datetime>

To date in ISO8601

source
string

Source of image (sentinel_2A or PLANET)

Request Body schema: application/json
integer

Responses

Request samples

Content type
application/json
0
0

Response samples

Content type
application/json
[
  • {
    }
]

Weather, Cropzone

Weather measurements at cropzone

An endpoint to get weather measurements at the selected cropzone location.

Authorizations:
bearerAuth
path Parameters
cropzone_id
required
string
query Parameters
page
integer
Default: 1

Page number

items
integer
Default: 50

Items per page

filter[from]
required
string or null <datetime>

From date in iso8601

filter[to]
required
string or null <datetime>

To date in iso8601

Responses

Response samples

Content type
application/json
"[{\"read_at"