Skip to main content
Use these endpoints to manage machines, implements, and operators for a Leaf user — whether synced from John Deere, CNHi, Stara, and Trimble or created manually through the API. For conceptual background, see Assets.
The Assets API is currently in beta. Endpoints, request/response schemas, and behavior may change without notice.

Base URL

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

Endpoints

EndpointMethodPath
Get all machinesGET/users/{leafUserId}/machines
Get a machineGET/users/{leafUserId}/machines/{machineId}
Get machine filesGET/users/{leafUserId}/machines/{machineId}/files
Create a machinePOST/users/{leafUserId}/machines
Update a machinePATCH/users/{leafUserId}/machines/{machineId}
Delete a machineDELETE/users/{leafUserId}/machines/{machineId}
Get all implementsGET/users/{leafUserId}/implements
Get an implementGET/users/{leafUserId}/implements/{implementId}
Get all operatorsGET/users/{leafUserId}/operators
Get an operatorGET/users/{leafUserId}/operators/{operatorId}

Machines

Get all machines

GET /users/{leafUserId}/machines Returns a paginated list of machines for a Leaf user.

Parameters

ParameterTypeDescription
namestringFilter by machine name.
providerstringFilter by provider (JohnDeere, Stara, CNHi).
providerOrganizationIdstringFilter by provider-side organization ID.
providerMachineIdstringFilter by provider-side machine ID.
serialNumberstringFilter by machine serial number.
originTypestringOrigin of the machine: USER_CREATED, FILE_POOLED, or PROVIDER_POOLED.
createdTimestring (ISO 8601)Must match exactly the creation timestamp.
beforeCreatedTimestring (ISO 8601)Records created before this timestamp.
afterCreatedTimestring (ISO 8601)Records created after this timestamp.
updatedAtstring (ISO 8601)Must match exactly the last-updated timestamp.
beforeUpdatedAtstring (ISO 8601)Records updated before this timestamp.
afterUpdatedAtstring (ISO 8601)Records updated after this timestamp.
vinstringFilter by Vehicle Identification Number.
pageintegerPage number (default 0).
sizeintegerPage size (default 20, max 100).
sortstringSorting order. Valid fields: id, leafUserId, name, provider, providerOrganizationId, providerMachineId, serialNumber, vin, model, make, category, modelYear. Append ,asc or ,desc.
The default page size is 20 when page and size are not set.

Request

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

Response

[
  {
    "id": "e89b1861-bdbb-49b9-8e11-74840f7e1ea8",
    "leafUserId": "faa6691a-7bf7-49c2-8934-b5b4c823aef8",
    "name": "TestName",
    "provider": "Leaf",
    "providerMachineId": "08790ae9-d451-4158-9920-09d1ab1ba5e6",
    "providerOrganizationId": "123456",
    "originType": "PROVIDER_POOLED",
    "createdTime": "2022-02-22T20:06:25.411Z",
    "serialNumber": "123456",
    "vin": "1234567890ABC",
    "model": "ModelName",
    "make": "MakerOfMachine",
    "category": "Sprayer",
    "modelYear": 2000
  },
  {
    "id": "82725746-3150-490d-9f3f-a47151ac0669",
    "leafUserId": "325f5ac0-6c57-4b4a-bdea-490ccddb06c4",
    "name": "nameTest",
    "provider": "Leaf",
    "providerMachineId": "75f362b4-8f61-46f9-905b-a357fb239930",
    "providerOrganizationId": "654321",
    "originType": "FILE_POOLED",
    "createdTime": "2022-02-22T20:06:25.411Z",
    "serialNumber": "123456",
    "vin": "1234567890ABC",
    "model": "ModelName",
    "make": "MakerOfMachine",
    "category": "Harvester",
    "modelYear": 2020
  }
]

Get a machine

GET /users/{leafUserId}/machines/{machineId} Returns details for a single machine by its ID.

Parameters

ParameterTypeDescription
leafUserIdstring (UUID)Path param — the Leaf user ID.
machineIdstring (UUID)Path param — the machine ID.

Request

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

Response

{
  "id": "e89b1861-bdbb-49b9-8e11-74840f7e1ea8",
  "leafUserId": "faa6691a-7bf7-49c2-8934-b5b4c823aef8",
  "name": "TestName",
  "provider": "Leaf",
  "providerMachineId": "08790ae9-d451-4158-9920-09d1ab1ba5e6",
  "providerOrganizationId": "123456",
  "originType": "PROVIDER_POOLED",
  "createdTime": "2022-02-22T20:06:25.411Z",
  "serialNumber": "123456",
  "vin": "1234567890ABC",
  "model": "ModelName",
  "make": "MakerOfMachine",
  "category": "Sprayer",
  "modelYear": 2000
}

Get machine files

GET /users/{leafUserId}/machines/{machineId}/files Returns operation files associated with a specific machine.

Parameters

ParameterTypeDescription
leafFileIdstring (UUID)Filter by Leaf file ID.
originTypestringUSER_CREATED, FILE_POOLED, or PROVIDER_POOLED.
createdTimestring (ISO 8601)Must match exactly the creation timestamp.
beforeCreatedTimestring (ISO 8601)Records created before this timestamp.
afterCreatedTimestring (ISO 8601)Records created after this timestamp.
startTimestring (ISO 8601)Must match exactly the operation start time.
endTimestring (ISO 8601)Must match exactly the operation end time.
beforeStartTimestring (ISO 8601)Operations that started before this timestamp.
afterStartTimestring (ISO 8601)Operations that started after this timestamp.
beforeEndTimestring (ISO 8601)Operations that ended before this timestamp.
afterEndTimestring (ISO 8601)Operations that ended after this timestamp.
distanceValuedoubleExact distance value.
greaterThanDistanceValuedoubleDistance greater than this value.
lessThanDistanceValuedoubleDistance less than this value.
distanceUnitstringMile, mile, Feet, or ft.
pageintegerPage number (default 0).
sizeintegerPage size (default 20, max 100).
sortstringValid fields: id, leafUserId, machineId, startTime, endTime, createdTime, leafFileId.
The default page size is 20 when page and size are not set.

Request

curl -X GET \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  'https://api.withleaf.io/services/beta/api/users/{leafUserId}/machines/{machineId}/files'

Response

[
  {
    "id": "e7916d05-97ae-404a-a467-e2512c202a2f",
    "leafFileId": "e0e18a6f-4f88-4801-96e2-f39143f260e1",
    "machineId": "98b244fc-7b2d-4acf-a51a-58d20ae27355",
    "startTime": "2022-02-22T20:06:25.411Z",
    "endTime": "2022-02-22T20:07:25.411Z",
    "distance": {
      "value": 4152.255,
      "unit": "ft"
    },
    "fuelConsumption": {
      "value": 28.89,
      "unit": "US gal"
    }
  }
]

Create a machine

POST /users/{leafUserId}/machines Creates a new machine for a Leaf user.

Request body

FieldTypeDescription
namestringMachine name.
serialNumberstringSerial number.
vinstringVehicle Identification Number.
modelstringModel name.
makestringManufacturer.
categorystringMachine category (e.g. Harvester, Sprayer).
modelYearintegerModel year.

Request

curl -X POST \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "nameTest",
    "serialNumber": "123456",
    "vin": "1234567890ABC",
    "model": "ModelName",
    "make": "MakerOfMachine",
    "category": "Harvester",
    "modelYear": 2020
  }' \
  'https://api.withleaf.io/services/beta/api/users/{leafUserId}/machines'

Response

{
  "id": "d5efe8a1-98be-40db-b2b2-2da332e8f69c",
  "name": "nameTest",
  "provider": "Leaf",
  "providerMachineId": "24de86ff-e6f0-4f8f-b429-0571c30a7ddf",
  "providerOrganizationId": "654321",
  "leafUserId": "9e081c9d-6185-49e1-8df7-7788d6aa1211",
  "originType": "USER_CREATED",
  "createdTime": "2023-06-12T17:38:09.148Z",
  "serialNumber": "123456",
  "vin": "1234567890ABC",
  "model": "ModelName",
  "make": "MakerOfMachine",
  "category": "Harvester",
  "modelYear": 2020
}

Update a machine

PATCH /users/{leafUserId}/machines/{machineId} Updates an existing machine for a Leaf user.
Only machines with originType of USER_CREATED can be updated. Machine data obtained from providers cannot be modified.

Request body

FieldTypeDescription
namestringUpdated machine name.
serialNumberstringUpdated serial number.
vinstringUpdated VIN.
modelstringUpdated model name.
makestringUpdated manufacturer.
categorystringUpdated category.
modelYearintegerUpdated model year.

Request

curl -X PATCH \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "updatedName",
    "serialNumber": "000123",
    "vin": "1234567890EFR",
    "model": "ModelNameUpdated",
    "make": "MakerOfMachineUpdated",
    "category": "Planted",
    "modelYear": 2021
  }' \
  'https://api.withleaf.io/services/beta/api/users/{leafUserId}/machines/{machineId}'

Response

{
  "id": "d5efe8a1-98be-40db-b2b2-2da332e8f69c",
  "name": "updatedName",
  "provider": "Leaf",
  "providerMachineId": "24de86ff-e6f0-4f8f-b429-0571c30a7ddf",
  "providerOrganizationId": "654321",
  "leafUserId": "9e081c9d-6185-49e1-8df7-7788d6aa1211",
  "originType": "USER_CREATED",
  "createdTime": "2023-06-12T17:38:09.148Z",
  "serialNumber": "000123",
  "vin": "1234567890EFR",
  "model": "ModelNameUpdated",
  "make": "MakerOfMachineUpdated",
  "category": "Planted",
  "modelYear": 2021
}

Delete a machine

DELETE /users/{leafUserId}/machines/{machineId} Deletes a machine by its ID.
Only machines with originType of USER_CREATED can be deleted. Machine data obtained from providers cannot be removed.

Parameters

ParameterTypeDescription
leafUserIdstring (UUID)Path param — the Leaf user ID.
machineIdstring (UUID)Path param — the machine ID.

Request

curl -X DELETE \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  'https://api.withleaf.io/services/beta/api/users/{leafUserId}/machines/{machineId}'

Implements

Get all implements

GET /users/{leafUserId}/implements Returns a paginated list of implements for a Leaf user. Currently supports John Deere and Trimble implements.

Parameters

ParameterTypeDescription
leafUserIdstring (UUID)Filter by Leaf user ID.
providerstringFilter by provider (JohnDeere, Trimble).
providerImplementIdstringFilter by provider-side implement ID.
providerOrganizationIdstringFilter by provider-side organization ID.
namestringFilter by implement name.
createdTimestring (ISO 8601)Returns records from the given creation time onward.
beforeCreatedTimestring (ISO 8601)Records created before this timestamp.
afterCreatedTimestring (ISO 8601)Records created after this timestamp.
updatedTimestring (ISO 8601)Returns records from the given update time onward.
beforeUpdatedTimestring (ISO 8601)Records updated before this timestamp.
afterUpdatedTimestring (ISO 8601)Records updated after this timestamp.
pageintegerPage number (default 0).
sizeintegerPage size (default 20, max 100).
sortstringValid fields: id, leafUserId, name, provider, providerOrganizationId, providerImplementId, serialNumber, model, make, category.
The default page size is 20 when page and size are not set.

Request

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

Response

[
  {
    "id": "38d313fc-e4ce-442b-9147-f469b30aedab",
    "name": "c3po_implement",
    "provider": "JohnDeere",
    "providerImplementId": "110237",
    "providerOrganizationId": "296264",
    "leafUserId": "mbba54fb-3710-4f7d-9aaf-703107930193",
    "originType": "PROVIDER_POOLED",
    "serialNumber": "00000",
    "model": "StMax150",
    "make": "JOHN DEERE",
    "category": "Cotton Harvester Implement"
  }
]

Get an implement

GET /users/{leafUserId}/implements/{implementId} Returns details for a single implement by its ID.

Parameters

ParameterTypeDescription
leafUserIdstring (UUID)Path param — the Leaf user ID.
implementIdstring (UUID)Path param — the implement ID.

Request

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

Response

{
  "id": "38d313fc-e4ce-442b-9147-f469b30aedab",
  "name": "c3po_implement",
  "provider": "JohnDeere",
  "providerImplementId": "110237",
  "providerOrganizationId": "296264",
  "leafUserId": "mbba54fb-3710-4f7d-9aaf-703107930193",
  "originType": "PROVIDER_POOLED",
  "serialNumber": "00000",
  "model": "StMax150",
  "make": "JOHN DEERE",
  "category": "Cotton Harvester Implement"
}

Operators

Get all operators

GET /users/{leafUserId}/operators Returns a paginated list of operators for a Leaf user. Currently supports John Deere operators.

Parameters

ParameterTypeDescription
pageintegerPage number (default 0).
sizeintegerPage size (default 20, max 100).
The default page size is 20 when page and size are not set.

Request

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

Response

[
  {
    "id": "aa8c917bc-7e9b-47bc-99b8-4a0df818ab07",
    "name": "Brian O.",
    "provider": "JohnDeere",
    "providerOperatorId": "bbd3a3e8-5ac3-4ab8-4619-d582da4568cc",
    "providerOrganizationId": "9999",
    "originType": "PROVIDER_POOLED",
    "license": null,
    "updatedTime": "2023-10-10T10:10:10.000Z",
    "status": "ACTIVE"
  }
]

Get an operator

GET /users/{leafUserId}/operators/{operatorId} Returns details for a single operator by its ID.

Parameters

ParameterTypeDescription
leafUserIdstring (UUID)Path param — the Leaf user ID.
operatorIdstring (UUID)Path param — the operator ID.

Request

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

Response

{
  "id": "aa8c917bc-7e9b-47bc-99b8-4a0df818ab07",
  "name": "Brian O.",
  "provider": "JohnDeere",
  "providerOperatorId": "bbd3a3e8-5ac3-4ab8-4619-d582da4568cc",
  "providerOrganizationId": "9999",
  "originType": "PROVIDER_POOLED",
  "license": null,
  "updatedTime": "2023-10-10T10:10:10.000Z",
  "status": "ACTIVE"
}
Last modified on March 24, 2026