Use these endpoints to upload prescription (Rx) maps to provider accounts. Depending on the provider, you can also list existing prescriptions or download them.
For conceptual background, see Prescriptions.
The Prescriptions API is currently in beta. Endpoints, request/response schemas, and behavior may change without notice.
Base URL
https://api.withleaf.io/services/beta/prescription/api
Endpoints
| Endpoint | Method | Path |
|---|
| Upload prescription to Raven Slingshot | POST | /users/{leafUserId}/ravenSlingshot |
| List prescriptions from Raven Slingshot | GET | /users/{leafUserId}/ravenSlingshot |
| Upload prescription to John Deere | POST | /users/{leafUserId}/johnDeere |
| List prescriptions from John Deere | GET | /users/{leafUserId}/johnDeere |
| Download prescription from John Deere | GET | /users/{leafUserId}/johnDeere/download |
| Upload prescription to CNHi | POST | /users/{leafUserId}/cnhi |
| List prescriptions from CNHi | GET | /users/{leafUserId}/cnhi |
| Upload prescription to Climate FieldView | POST | /users/{leafUserId}/climateFieldView |
| Upload prescription to Trimble | POST | /users/{leafUserId}/trimble |
| Upload prescription to AgLeader | POST | /users/{leafUserId}/agleader |
Raven Slingshot
Upload prescription to Raven Slingshot
POST /users/{leafUserId}/ravenSlingshot
Uploads a prescription file using the Raven Slingshot credentials of a Leaf user.
The file must be a .zip containing one each of .shp, .dbf, and .shx — all sharing the same base name. The zip cannot contain subfolders.
Request
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'file=@prescription_rx_map.zip' \
'https://api.withleaf.io/services/beta/prescription/api/users/{leafUserId}/ravenSlingshot'
Response
{
"id": "str",
"name": "str"
}
List prescriptions from Raven Slingshot
GET /users/{leafUserId}/ravenSlingshot
Lists existing prescriptions available in Raven Slingshot for the Leaf user.
Request
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/beta/prescription/api/users/{leafUserId}/ravenSlingshot'
Response
[
{
"id": "str",
"name": "str"
}
]
John Deere
Upload prescription to John Deere
POST /users/{leafUserId}/johnDeere
Uploads a prescription file using the John Deere credentials of a Leaf user.
The organizationId query parameter is required and must be the organization ID from John Deere.
The file must be a .zip containing a folder named Rx/ with one each of .shp, .dbf, and .shx — all sharing the same base name.
Parameters
| Parameter | Type | Description |
|---|
organizationId | string | Required. The John Deere organization ID. |
Request
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'file=@prescription_rx_map.zip' \
'https://api.withleaf.io/services/beta/prescription/api/users/{leafUserId}/johnDeere?organizationId={organizationId}'
Response
{
"id": "str",
"name": "str"
}
List prescriptions from John Deere
GET /users/{leafUserId}/johnDeere
Lists existing prescriptions available in John Deere for the Leaf user.
Parameters
| Parameter | Type | Description |
|---|
organizationId | string | Required. The John Deere organization ID. |
Request
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/beta/prescription/api/users/{leafUserId}/johnDeere?organizationId={organizationId}'
Response
[
{
"id": "str",
"name": "str"
}
]
Download prescription from John Deere
GET /users/{leafUserId}/johnDeere/download
Downloads a prescription by its John Deere file ID. The fileId parameter refers to the ID on the John Deere side.
Parameters
| Parameter | Type | Description |
|---|
fileId | string | Required. The file ID from John Deere. |
Request
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/beta/prescription/api/users/{leafUserId}/johnDeere/download?fileId={fileId}'
Response
{
"fileUrl": "url_to_download"
}
CNHi
Upload prescription to CNHi
POST /users/{leafUserId}/cnhi
Uploads a prescription file using the CNHi credentials of a Leaf user.
The companyId query parameter is required. You can obtain this value from the grower endpoints using the providerOrganizationId property.
The file must be a .zip containing one each of .shp, .dbf, and .shx — all sharing the same base name. No subfolders.
Parameters
| Parameter | Type | Description |
|---|
companyId | string | Required. The CNHi company ID (providerOrganizationId). |
Request
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'file=@prescription_map.zip' \
'https://api.withleaf.io/services/beta/prescription/api/users/{leafUserId}/cnhi?companyId={companyId}'
Response
{
"id": "str",
"name": "str"
}
List prescriptions from CNHi
GET /users/{leafUserId}/cnhi
Lists existing prescriptions available in CNHi for the Leaf user.
Parameters
| Parameter | Type | Description |
|---|
companyId | string | Required. The CNHi company ID. |
Request
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/beta/prescription/api/users/{leafUserId}/cnhi?companyId={companyId}'
Response
[
{
"id": "str",
"name": "str"
}
]
Climate FieldView
Upload prescription to Climate FieldView
POST /users/{leafUserId}/climateFieldView
Uploads a prescription file using the Climate FieldView credentials of a Leaf user.
The file must be a .zip containing one each of .shp, .dbf, and .shx — all sharing the same base name. No subfolders.
Request
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'file=@prescription_rx_map.zip' \
'https://api.withleaf.io/services/beta/prescription/api/users/{leafUserId}/climateFieldView'
Response
{
"id": "str",
"name": "str"
}
Trimble
Upload prescription to Trimble
POST /users/{leafUserId}/trimble
Uploads a prescription file using the Trimble credentials of a Leaf user.
The organizationId, rateColumn, and rateUnit query parameters are required.
rateColumn must be the column name from the Shapefile. rateUnit must be one of the supported units listed below.
The file must be a .zip containing one each of .shp, .dbf, and .shx — all sharing the same base name. No subfolders.
Parameters
| Parameter | Type | Description |
|---|
organizationId | string | Required. The Trimble organization ID. |
rateColumn | string | Required. Column name from the Shapefile. |
rateUnit | string | Required. One of: gal/ac, l/ha, lbs/ac, ton/ac, kg/ha, t/ha, kS/ac, kS/ha, lbs(N)/ac, kg(N)/ha, S/ha. |
Request
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'file=@prescription_rx_map.zip' \
'https://api.withleaf.io/services/beta/prescription/api/users/{leafUserId}/trimble?organizationId={organizationId}&rateColumn=Rate&rateUnit=lbs/ac'
Response
{
"id": "str",
"name": "str"
}
AgLeader
Upload prescription to AgLeader
POST /users/{leafUserId}/agleader
Uploads a prescription file using the AgLeader credentials of a Leaf user.
The file must be a .zip containing one each of .shp, .dbf, and .shx — all sharing the same base name. No subfolders.
Request
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'file=@prescription_rx_map.zip' \
'https://api.withleaf.io/services/beta/prescription/api/users/{leafUserId}/agleader'
Response
{
"id": "str",
"name": "str"
}