Field Operations Endpoints
[files_sample]: https://docs.withleaf.io/docs/machine_file_conversion_sample_output#machine-file-sample]
About
All HTTP methods should be prepended by this service's endpoint:
This service has the following endpoints available:
Description | Endpoints |
---|---|
Get all operations | GET /operations |
Get an operation | GET /operations/{id} |
Get the operation's summary | GET /operations/{id}/summary |
Get the operation's standardGeojson | GET /operations/{id}/standardGeojson |
Get the operation's standardGeoParquet | GET /operations/{id}/standardGeoparquet |
Get the operation's filteredGeojson | GET /operations/{id}/filteredGeojson |
Get the operation's filteredGeoParquet | GET /operations/{id}/filteredGeoparquet |
Get operation's images | GET /operations/{id}/images |
Get operation's images V2 | GET /operations/{id}/imagesV2 |
Get operation's geotiff images | GET /operations/{id}/geotiffImages |
Get the operation's units | GET /operations/{id}/units |
Get the operation's machines | GET /operations/{id}/machines |
Get the operation's implements | GET /operations/{id}/implements |
Get the operation's operators | GET /operations/{id}/operators |
Get the operation's sessions | GET /operations/{id}/sessions |
Crop operation by field | POST /operations/cropOperationByField |
Reprocess an operation | POST /operations/{id}/reprocess |
Get files from an operation | GET /operations/{id}/files |
For easily testing these endpoints, we recommend using our Postman collection.
Get all operations
 GET /operations
Gets a paged list of operations that belong to the current logged in user. It is possible to filter the results by passing some query parameters. They are listed below.
Parameter (to filter by) | Values |
---|---|
leafUserId | uuid of one of your users |
provider | CNHI , JohnDeere , Trimble , ClimateFieldView , AgLeader , Stara or Leaf |
startTime | ISO 8601 date. Returns operations from the startTime onward |
updatedTime | ISO 8601 date. Returns operations from the updatedTime onward |
endTime | ISO 8601 date. Returns operations until the endTime |
operationType | applied , planted , harvested or tillage |
fieldId | the field where the operation happened |
You can also pass some parameters used exclusively for paging through results. They are:
page
, an integer specifying the page being fetched (default is 0)size
, an integer specifying the size of the page (max is 100)sort
, the sorting order of the results; can be multi-value, where the first value to be passed will have preference in ordering over the next ones; you can also specify the order asasc
ordesc
withasc
being the default. Example: id, desc- Valid values for sorting are: id, leafUserId, startTime, endTime, type and updatedTime.
the default value for page size is 20
If the parameters page and size are not set, the endpoint will return 20 results.
Request examples
- cURL
- Python
- JavaScript
Response
Get an operation
 GET /operations/{id}
Gets a single operation by its id.
Request examples
- cURL
- Python
- JavaScript
Response
Get the operation's summary
 GET /operations/{id}/summary
Gets the summary, if available, for the operation id.
Request examples
- cURL
- Python
- JavaScript
Response
Here's a link with sample responses for "planted", "applied", "harvested" and "tillage" operations.
Get the operation's standardGeojson
 GET /operations/{id}/standardGeojson
Get the standardGeojson file URL relative to the operation.
Request examples
- cURL
- Python
- JavaScript
Response
Get the operation's standardGeoparquet
 GET /operations/{id}/standardGeoparquet
Get the standard GeoParquet file URL relative to the operation.
tip
To use this option, enableGeoparquetOutput configuration must be enabled.
Request examples
- cURL
- Python
- JavaScript
Response
Get the operation's filteredGeojson
 GET /operations/{id}/filteredGeojson
Get the filteredGeojson file URL relative to the operation.
tip
To use this option, the operationsFilteredGeojson configuration must be enabled.
Request examples
- cURL
- Python
- JavaScript
Response
Get the operation's filteredGeoparquet
 GET /operations/{id}/filteredGeoparquet
Get the filtered GeoParquet file URL relative to the operation.
tip
To use this option, the operationsFilteredGeojson and enableGeoparquetOutput configuration must be enabled.
Request examples
- cURL
- Python
- JavaScript
Response
Get operation's images
 GET /operations/{id}/images
Gets a list of PNG images generated from the operation's properties.
Request examples
- cURL
- Python
- JavaScript
Response
The property
refers to the property extracted from operations' data to generate the
image. In the example above, the image would represent the elevation.
The ramp
is the color ramp used to generate the image. The percentages
correspond to the minimum (0%) and maximum (100%) values in the image. The
listed values correspond to RGB values used. The nv
refers to no value
. It
is used internally to make the image transparent on places without data.
Currently, this ramp is the same in all images processed.
We also generate an auxiliary xml
with geographic information to handle this
image on GIS environments. You just need to append the ".aux.xml"
string to the png url.
Get operation's images V2
 GET /operations/{id}/imagesV2
Gets a list of PNG images generated from the operation's properties with improvements in the generation process. These images are based on the filteredGeojson.
Request examples
- cURL
- Python
- JavaScript
Response
The property
refers to the property extracted from operations' data to generate the
image.
The legend
represents the values distributed in 7 classes, classified by the quantile and symbolized by the standard color ramp.
The extent
is the coordinates of the image, mainly used for plotting images in map applications.
More information here.
Get operation's geotiff images
 GET /operations/{id}/geotiffImages
Gets a list of TIFF images generated from the operation's properties with improvements in the generation process. These images are based on the filteredGeojson.
Request examples
- cURL
- Python
- JavaScript
Response
Get the operation's units
 GET /operations/{id}/units
Gets the operations's properties and their units.
Request examples
- cURL
- Python
- JavaScript
Response
Here's a link with sample responses for "planted", "applied", "harvested" and "tillage" operations.
These properties vary depending on the operationType, but you can expect the same, standardized keys, across different providers.
Units usually don't change for the same Leaf User, since the providers units configuration is based on their location. But keep in mind that it's best to always take the units into consideration, just to be sure.
Get the operation's machines
 GET /operations/{id}/machines
Gets the machines used in the given operation. The IDs returned can be used to fetch more information about the machine in the Get a machine endpoint.
Request examples
- cURL
- Python
- JavaScript
Response
Get the operation's implements
 GET /operations/{id}/implements
Gets the implements used in the given operation. The IDs returned can be used to fetch more information about the implement in the Get an implement endpoint.
Request examples
- cURL
- Python
- JavaScript
Response
Get the operation's operators
 GET /operations/{id}/operators
Gets the operators that performed the given operation. The IDs returned can be used to fetch more information about the operator in the Get an operator endpoint.
Request examples
- cURL
- Python
- JavaScript
Response
Get the operation's sessions
 GET /operations/{id}/sessions
Get compiled machine, implement and operator data for a management view with total area covered and working hours.
Important
It requires the enableOperationsSession
configuration enabled to create this data.
Currently, this information is only available for John Deere operations.
Request examples
- cURL
- Python
- JavaScript
Response
Crop operation by field
 POST /operations/cropOperationByField
This endpoint can be used to remove points from the operation standardGeojson that are outside of the field geometry.
Request examples
- cURL
- Python
- JavaScript
Response
You could monitor the processing status using the leafFileId
by our Alerts Service.
Get files from an operation
 GET /operations/{id}/files
Allow the user to fetch all files resources that were aggregated to generate an Field Operation.
Request examples
- cURL
- Python
- JavaScript
Response
Check our sample response to have complete represention on the expected output.
Reprocess an operation
 POST /operations/{id}/reprocess
Allows reprocessing an operation already created, starting from the merge step. The standardGeoJSON, filteredGeoJSON, summary and images will be updated.
Request examples
- cURL
- Python
- JavaScript
You could monitor the processing status by our Alerts Service.
Alerts
With Alerts you can be notified when something happens or changes instead of needing to repeatedly query for changes. Leaf Alerts support events that happen within Leaf and events that happen within supported 3rd party software.
List of Operations Events
Leaf Operations Service can Alert you on these events: list of Operations Events