This guide covers how to migrate an existing CNHI (AFS Connect) integration to CNHI FieldOps. You can migrate at your own pace — both providers run in parallel, and no growers are disrupted until you choose to switch them.Documentation Index
Fetch the complete documentation index at: https://docs.withleaf.io/llms.txt
Use this file to discover all available pages before exploring further.
What changed
CNHI FieldOps is CNH Industrial’s current API platform. The data you receive through Leaf — field operations, machine files, boundaries — is the same. What changes is how the connection is established.| Aspect | CNHI (AFS Connect) | CNHI FieldOps |
|---|---|---|
| Leaf credential path | cnhi-credentials | cnhi-field-ops-credentials |
| Leaf OAuth helper | /get_url, /get_token | /fieldops/get_url, /fieldops/get_token |
| Magic Link / Leaf Link provider name | CNHI | CNHIFieldOps |
| Subscription keys | Legacy keys | New keys required (legacy keys do not work) |
| Change detection | Polling (Leaf checks periodically) | Webhooks (CNH pushes changes to Leaf) |
| Token format | Opaque | JWT |
What you need before migrating
- A CNH developer account at develop.cnh.com (company-domain email required — Gmail, Hotmail, and other generic domains are not supported).
- A new FieldOps application registered in the developer portal. This produces a new
clientId,clientSecret, andsubscriptionKey. Existing CNHI credentials cannot be reused. - Each grower must re-authorize through the FieldOps OAuth flow. Existing refresh tokens do not carry over.
- Growers must have the Farm Manager title in their FieldOps account and must have logged into the FieldOps portal at least once.
Migration approach: run both in parallel
Leaf treats CNHI and CNHI FieldOps as separate providers. A single Leaf user can hold bothcnhi-credentials and cnhi-field-ops-credentials at the same time. This means you can migrate growers one at a time without disrupting anyone.
The recommended approach:
- Register your CNHI FieldOps app keys with Leaf:
-
For each grower you want to migrate:
- Run the FieldOps OAuth flow (via the Leaf helper or Magic Link)
- Attach
cnhi-field-ops-credentialsto the Leaf user - Verify data syncs correctly
- Once confirmed, delete the old
cnhi-credentialsfrom the Leaf user
- Growers you haven’t migrated yet continue working on the legacy CNHI provider with no disruption.
Identifying FieldOps data in the API
Data from CNHI FieldOps appears in the same Leaf endpoints (fields, files, operations) as legacy CNHI data. Theprovider field distinguishes the source:
- Legacy CNHI:
"provider": "CNHI" - CNHI FieldOps:
"provider": "CNHIFieldOps"
?provider=CNHIFieldOps) to see only FieldOps data. During the parallel-run period, the same physical field may appear twice with different provider values.
Abbreviated setup steps
For the full walkthrough with code examples in cURL, Python, and JavaScript, see Connect CNHI FieldOps. The key steps:- Get the authorization URL —
POST https://cnhi-oauth2-helper.withleaf.io/fieldops/get_urlwithclient_id,client_redirect_url, andproductionflag. - Redirect the grower — they log in and consent.
- Exchange the code for a refresh token —
POST https://cnhi-oauth2-helper.withleaf.io/fieldops/get_tokenwithclient_id,client_secret,client_redirect_url, andresponse_url. - Attach credentials to the Leaf user —
POST /users/{leafUserId}/cnhi-field-ops-credentialswithclientId,clientSecret,subscriptionKey,refreshToken, andclientEnvironment. - Confirm —
GET /users/{leafUserId}/cnhi-field-ops-credentials.
Updating Magic Link and Leaf Link
If you use Magic Link or Leaf Link widgets to onboard growers:- Register your FieldOps app keys with Leaf:
-
Add
https://widget.withleaf.ioas a callback URL in your CNHI FieldOps application on the CNH developer portal. -
Update your
allowedProvidersto include"CNHIFieldOps". During the transition, you can include both"CNHI"and"CNHIFieldOps"so growers can connect through either provider.
What to do next
- CNHI FieldOps provider guide — Credentials schema, endpoints, and troubleshooting.
- Connect CNHI FieldOps tutorial — Full step-by-step with code examples.
- Provider credentials API reference — Endpoint reference for all providers.

