Irrigation Endpoints

About

Here we list all the available endpoints from Leaf's Irrigation API. To call them easily, we recommend using Leaf's Postman collection.

All HTTP methods should be prepended by this service's endpoint:

https://api.withleaf.io/services/irrigation/api

This service has the following endpoints available:

DescriptionEndpoints
Get all irrigation equipmentGET /users/{leafUserId}/irrigation-equipment
Get an irrigation equipmentGET /users/{leafUserId}/irrigation-equipment/{id}
Get as-applied irrigationGET /users/{leafUserId}/irrigation/applied-irrigation
Get an irrigation activityGET /users/{leafUserId}/irrigation/applied-irrigation/{id}
Get all irrigated fieldsGET /users/{leafUserId}/irrigation/fields
Get an irrigated fieldGET /users/{leafUserId}/irrigation/fields/{fieldId}
Get an irrigated field activityGET /users/{leafUserId}/irrigation/fields/{fieldId}/irrigated/{id}

Get all irrigation equipment

 GET /users/{leafUserId}/irrigation-equipment

Lists all irrigation system equipment available for a given leaf user. It is possible to filter the results by passing some query parameters:

Parameter (to filter by)Values
providerEquipmentIdProvider equipment ID
providerLindsay or Valley

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/irrigation/api/users/{leafUserId}/irrigation-equipment'

Response

[
{
"id": "uuid",
"providerEquipmentId": "uuid",
"provider": "Lindsay",
"name": "HHD 700C",
"type": "pivot",
"pivotLength": {
"value": 0.0,
"unit": "m"
},
"endgunLength": {
"value": 0.0,
"unit": "m"
},
"pivotRuntime": {
"value": 0.0,
"unit": "hr"
},
"brand": "unknown",
"originalEquipmentData": {
"equipmentType": "",
"equipmentSubType": ""
}
}
]

Properties

These are the properties available:

PropertyDescription
idThe equipment ID
providerEquipmentIdThe equipment ID from the provider
providerThe data provider: Lindsay or Valley
nameThe name of the equipment
typeThe irrigation system type
pivotLengthThe length of the equipment (meters or feet)
endgunLengthThe length of the endgun throw (meters or feet)
pivotRuntimeThe time a pivot takes to complete a full revolution (hours)
brandThe brand of the equipment
originalEquipmentDataNot normalized equipment information data such as original type and subtype as available in the provider

* The unit of measure can be defined by the unitMeasurement configuration.

Get an irrigation equipment

 GET /users/{leafUserId}/irrigation-equipment/{id}

Get a specific irrigation system equipment by ID.

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/irrigation/api/users/{leafUserId}/irrigation-equipment/{id}'

Response

{
"id": "uuid",
"providerEquipmentId": "uuid",
"provider": "Lindsay",
"name": "HHD 700C",
"type": "pivot",
"pivotLength": {
"value": 0.0,
"unit": "m"
},
"endgunLength": {
"value": 0.0,
"unit": "m"
},
"pivotRuntime": {
"value": 0.0,
"unit": "hr"
},
"brand": "unknown",
"originalEquipmentData": {
"equipmentType": "",
"equipmentSubType": ""
}
}

Properties

These are the properties available:

PropertyDescription
idThe equipment ID
providerEquipmentIdThe equipment ID from the provider
providerThe data provider: Lindsay or Valley
nameThe name of the equipment
typeThe irrigation system type
pivotLengthThe length of the equipment (meters or feet)
endgunLengthThe length of the endgun throw (meters or feet)
pivotRuntimeThe time a pivot takes to complete a full revolution (hours)
brandThe brand of the equipment
originalEquipmentDataNot normalized equipment information data such as original type and subtype as available in the provider

* The unit of measure can be defined by the unitMeasurement configuration.

Get as-applied irrigation

 GET /users/{leafUserId}/irrigation/applied-irrigation

Lists all irrigation activities from supported providers, summarized by day and with information on the amount of water applied, stored in the depth property. The area covered by the irrigation and the different geometries for each depth value are also available in the irrigation standardGeojson. It is possible to filter the results by passing some query parameters:

Parameter (to filter by)Values
providerLindsay or Valley
startTimeReturns irrigation data from the startTime onward
endTimeReturns irrigation data until the endTime

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/irrigation/api/users/{leafUserId}/irrigation/applied-irrigation'

Response

[
{
"id": "uuid",
"provider": "Lindsay",
"standardGeojson": "url.json",
"downloadStandardGeojson": "url.json",
"leafUserId": "uuid",
"apiOwnerUsername": "apiowner@withleaf.io",
"summary": {
"type": "Feature",
"properties": {
"depth": {
"avg": 4.87,
"sum": 28.36,
"min": 2.53,
"max": 7.49,
"unit": "mm"
},
"totalArea": {
"value": 52.72,
"unit": "ha"
},
"totalVolume": {
"value": 1604.7,
"unit": "L"
},
"totalPowerOn": {
"value": 16.7,
"unit": "hr"
}
},
"geometry": { }
},
"equipment": [
{
"id": "uuid",
"name": "My Pivot",
"type": "pivot",
"providerEquipmentId": "d0245010-157d-4988-96a2-5f3637098475"
}
],
"createdTime": "2024-03-04T00:31:25.497Z",
"startTime": "2024-01-07T00:00:00Z",
"endTime": "2024-01-07T23:59:59Z"
}
]

Properties

These are the properties available:

PropertyDescription
idThe record identifier
leafUserIdThe Leaf User identifier
apiOwnerUsernameThe API Owner username
startTimeThe start of the irrigation period, typically the first hour of the day
endTimeThe end of the irrigation period, typically the last hour of the day
providerThe irrigation data provider. It can be Lindsay or Valley
equipmentThe list of equipment that performed the irrigation, may contain the id, name, type and the identifier of the equipment at the provider (providerEquipmentId)
createdTimeThe time the record was created in Leaf
Summary

Each record shows a summary of the day, with the following properties:

PropertyUnit of measureDescription
depthmm or inBasic statistics on the amount of water applied
totalAreaha or acTotal irrigated area
totalVolumeL or galTotal volume applied
totalPowerOnhrTotal time the pivot was ON for the given day
geometry-The geometry that represents the irrigated area

* The unit of measure can be defined by the unitMeasurement configuration.

Irrigation field

Irrigation StandardGeojson

The GeoJSON file for applied irrigation shows all irrigation values ​​from an equipment for a given day. The file contains multipolygon geometries that represent the amount of water application for each area, in the depth property. To view the field-related information, check the Get an irrigated field endpoint.

Irrigation data

Get an irrigation activity

 GET /users/{leafUserId}/irrigation/applied-irrigation/{id}

Gets an irrigation activity by ID.

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/irrigation/api/users/{leafUserId}/irrigation/applied-irrigation/{id}'

Response

{
"id": "uuid",
"provider": "Lindsay",
"standardGeojson": "url.json",
"downloadStandardGeojson": "url.json",
"leafUserId": "uuid",
"apiOwnerUsername": "apiowner@withleaf.io",
"summary": {
"type": "Feature",
"properties": {
"depth": {
"avg": 4.87,
"sum": 28.36,
"min": 2.53,
"max": 7.49,
"unit": "mm"
},
"totalArea": {
"value": 52.72,
"unit": "ha"
},
"totalVolume": {
"value": 1604.7,
"unit": "L"
},
"totalPowerOn": {
"value": 16.7,
"unit": "hr"
}
},
"geometry": { }
},
"equipment": [
{
"id": "uuid",
"name": "My Pivot",
"type": "pivot",
"providerEquipmentId": "d0245010-157d-4988-96a2-5f3637098475"
}
],
"createdTime": "2024-03-04T00:31:25.497Z",
"startTime": "2024-01-07T00:00:00Z",
"endTime": "2024-01-07T23:59:59Z"
}

Get all irrigated fields

 GET /users/{leafUserId}/irrigation/fields

Lists all fields that have received any irrigation at some point. It is possible to filter the results by passing some query parameters:

Parameter (to filter by)Values
equipmentIdLeaf equipment ID
startTimeReturns irrigation data from the startTime onward
endTimeReturns irrigation data until the endTime

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/irrigation/api/users/{leafUserId}/irrigation/fields'

Response

[
{
"fieldId": "95eb7d79-b93d-4fc2-877a-3f2b366f8beb",
"lastIrrigationTime": "2024-02-18T23:59:59.000000Z"
}
]

Get an irrigated field

 GET /users/{leafUserId}/irrigation/fields/{fieldId}

Gets information about irrigation performed in a specific field. It is valid for all existent field boundary from the Leaf user account. It is possible to filter the results by passing some query parameters:

Parameter (to filter by)Values
irrigationIdAs-applied irrigation ID
providerLindsay or Valley
startTimeReturns irrigation data from the startTime onward
endTimeReturns irrigation data until the endTime
Field boundary

This functionality associates field boundaries from any provider with irrigation data, so there must be existing field boundaries in the integrated leaf user to access it. Valley does not provide field boundaries and Lindsay requires the FieldNET Advisor product to make them available.

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/irrigation/api/users/{leafUserId}/irrigation/fields/{fieldId}'

Response

[
{
"id": "uuid",
"fieldId": "uuid",
"irrigationId": ["uuid"],
"provider": "Lindsay",
"standardGeojson": "url.json",
"downloadStandardGeojson": "url.json",
"leafUserId": "uuid",
"apiOwnerUsername": "apiowner@withleaf.io",
"summary": {
"type": "Feature",
"properties": {
"depth": {
"avg": 4.87,
"sum": 28.36,
"min": 2.53,
"max": 7.49,
"unit": "mm"
},
"totalArea": {
"value": 49.48,
"unit": "ha"
},
"totalVolume": {
"value": 1604.7,
"unit": "L"
},
"totalPowerOn": {
"value": 16.7,
"unit": "hr"
},
"coverage": {
"value": 81.51,
"unit": "percentage"
}
},
"geometry": { }
},
"equipment": [
{
"id": "uuid",
"name": "My Pivot",
"type": "pivot",
"providerEquipmentId": "d0245010-157d-4988-96a2-5f3637098475"
}
],
"createdTime": "2024-03-04T00:31:25.497Z",
"startTime": "2024-01-07T00:00:00Z",
"endTime": "2024-01-07T23:59:59Z"
}
]

Properties

These are the properties available:

PropertyDescription
idThe record identifier
leafUserIdThe Leaf User identifier
apiOwnerUsernameThe API Owner username
startTimeThe start of the irrigation period, typically the first hour of the day
endTimeThe end of the irrigation period, typically the last hour of the day
providerThe irrigation data provider. It can be Lindsay or Valley
equipmentThe list of equipment that performed irrigation, may contain the id, name, type and the identifier of the equipment at the provider (providerEquipmentId)
createdTimeThe time the record was created in Leaf
Summary

Each record shows a summary of the day, with the following properties:

PropertyUnitDescription
depthmm or inBasic statistics on the amount of water applied
totalAreaha or acTotal irrigated area for that given field
totalVolumeL or galTotal volume applied
totalPowerOnhrTotal time the pivot was ON for the given day
coverage%The percentage of field area covered by irrigation - the wetted area
geometry-The geometry that represents the field irrigated area

* The unit of measure can be defined by the unitMeasurement configuration.

Irrigation field

Irrigated field StandardGeojson

The GeoJSON file available for the irrigated field will show all irrigated areas within the field ​​from an equipment for a given day. Each geometry is represented as multi polygons and is clipped by the field boundary geometry and represents the total volume of water applied to the location (the depth property).

Irrigation field

Get an irrigated field activity

 GET /users/{leafUserId}/irrigation/fields/{fieldId}/irrigated/{id}

Gets information about an irrigation activity performed in a specific field.

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/irrigation/api/users/{leafUserId}/irrigation/fields/{fieldId}/irrigated/{id}'

Response

{
"id": "uuid",
"fieldId": "uuid",
"irrigationId": ["uuid"],
"provider": "Lindsay",
"standardGeojson": "url.json",
"downloadStandardGeojson": "url.json",
"leafUserId": "uuid",
"apiOwnerUsername": "apiowner@withleaf.io",
"summary": {
"type": "Feature",
"properties": {
"depth": {
"avg": 4.87,
"sum": 28.36,
"min": 2.53,
"max": 7.49,
"unit": "mm"
},
"totalArea": {
"value": 49.48,
"unit": "ha"
},
"totalVolume": {
"value": 1604.7,
"unit": "L"
},
"totalPowerOn": {
"value": 16.7,
"unit": "hr"
},
"coverage": {
"value": 81.51,
"unit": "percentage"
}
},
"geometry": { }
},
"equipment": [
{
"id": "uuid",
"name": "My Pivot",
"type": "pivot",
"providerEquipmentId": "d0245010-157d-4988-96a2-5f3637098475"
}
],
"createdTime": "2024-03-04T00:31:25.497Z",
"startTime": "2024-01-07T00:00:00Z",
"endTime": "2024-01-07T23:59:59Z"
}