Base URL
Endpoints
Fields
Get all fields
GET/fields
Returns a paginated list of fields across all Leaf users. You can narrow results with query parameters.
Parameters
The default page size is 20 when
page and size are not set.Request
Response
Get a field
GET/users/{leafUserId}/fields/{id}
Returns a single field for the specified Leaf user.
Parameters
Request
Response
Returns a single field object (same shape as the objects in the Get all fields response).Create a field
POST/users/{leafUserId}/fields
Creates a field for the specified Leaf user. The request body must include a geometry property with type set to MultiPolygon.
You can optionally set id and name. If you omit id, Leaf generates a UUID. The id cannot be changed after creation.
Parameters
Request body
Request
Response
Update a field
PATCH/users/{leafUserId}/fields/{id}
Updates a field. You can update name, farmId, and geometry. If you update the geometry, Leaf creates a new active boundary and sets the previous one to inactive.
Parameters
Request body
Request
Response
Returns the updated field object.Delete a field
DELETE/users/{leafUserId}/fields/{id}
Deletes a manually created field.
Parameters
Request
Get all operation files of a field
GET/users/{leafUserId}/fields/{fieldId}/operations/files
Returns a paginated list of machine files associated with the specified field.
Parameters
Request
Response
Get an operation file of a field
GET/users/{leafUserId}/fields/{fieldId}/operations/files/{fileId}
Returns a single machine file associated with the specified field.
Parameters
Request
Response
Get fields by geometry
POST/users/{leafUserId}/fields/intersects
Returns all fields that intersect with the provided GeoJSON MultiPolygon geometry.
The intersectionThreshold parameter (default 0.01, range 0.01–100) sets the minimum overlap percentage required. The API checks both “intersection by field” and “intersection by geometry” ratios and returns the field if either exceeds the threshold.
Parameters
Request body
Request
Response
Returns a list of field objects that match the intersection criteria.Get intersection of fields
POST/users/{leafUserId}/fields/intersect
Returns the MultiPolygon geometry representing the intersection of the specified fields.
Parameters
Request body
Request
Response
Sync fields manually
POST/users/{leafUserId}/fields/sync
Schedules a sync to fetch field boundaries from connected providers. Use this when fieldsAutoSync is disabled.
Parameters
Request
Enable a preview field
POST/users/{leafUserId}/fields/{id}/enableSync
Removes a field from PREVIEW mode and queues it for the next sync. The field status changes to WAITING, and after syncing it becomes PROCESSED.
Parameters
Request
Upload a field to provider
POST/users/{leafUserId}/fields/{fieldId}/integration/{providerName}
Pushes a Leaf field boundary to a connected provider. Supported providers: JohnDeere, ClimateFieldView.
Parameters
Request
Response
Returns one object keyed by the Leaf field ID. Inside that object, the provider name maps to the provider-specific upload response.Boundaries
Get all boundaries
GET/users/{leafUserId}/fields/{fieldId}/boundaries
Returns all boundaries (active and inactive) for a field. Leaf keeps a history of all boundary changes.
Parameters
Request
Response
Get a boundary
GET/users/{leafUserId}/fields/{fieldId}/boundaries/{boundaryId}
Returns a single boundary by ID.
Parameters
Request
Response
Returns a single boundary object (same shape as objects in the Get all boundaries response).Get active boundary
GET/users/{leafUserId}/fields/{fieldId}/boundary
Returns the currently active boundary for a field.
Parameters
Request
Response
Returns a single boundary object.Update active boundary
PUT/users/{leafUserId}/fields/{fieldId}/boundary
Replaces the active boundary with a new geometry. The previous active boundary is preserved as an inactive historical record.
Parameters
Request body
Request
Response
Farms
Get all farms
GET/farms
Returns a paginated list of all farms.
Parameters
Request
Response
Get a farm
GET/users/{leafUserId}/farms/{id}
Returns a single farm by ID.
Parameters
Request
Response
Returns a single farm object (same shape as objects in the Get all farms response).Create a farm
POST/users/{leafUserId}/farms
Creates a farm for the specified Leaf user.
Parameters
Request body
Request
Response
Returns the created farm object.Update a farm
PUT/users/{leafUserId}/farms/{id}
Updates a farm’s name and/or growerId.

