CNH Industrial (Case IH, New Holland, Steyr) exposes two API platforms. Leaf supports both as separate providers: CNHI (AFS Connect) (this page) and CNHI FieldOps. If you’re starting a new integration, use CNHI FieldOps. Leaf connects to CNHI AFS Connect using OAuth 2.0. Once connected, Leaf syncs growers, farms, fields, machine files, and field operations.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.
Prerequisites
- A CNHi developer account. Register here.
- Your application’s
clientId,clientSecret, andsubscriptionKeyfrom CNHi. - A grower’s
refreshTokenobtained through the CNHi OAuth 2.0 consent flow.
Setup steps
- Complete the CNHi OAuth 2.0 flow to obtain a
refreshTokenfor the grower’s account. - POST the credentials to Leaf:
- Leaf validates the token and begins syncing. Check credential status with
GET /users/{leafUserId}/cnhi-credentials.
Credentials schema
Create request body:| Field | Type | Required | Description |
|---|---|---|---|
clientId | string | Yes | Your application’s client ID from CNHi |
clientSecret | string | Yes | Your application’s client secret |
subscriptionKey | string | Yes | Your CNHi subscription key |
refreshToken | string | Yes | The grower’s OAuth refresh token |
clientEnvironment | string | Yes | STAGE or PRODUCTION |
Endpoints
Base URL:https://api.withleaf.io/services/usermanagement/api
| Action | Method | Path |
|---|---|---|
| Get credentials | GET | /users/{leafUserId}/cnhi-credentials |
| Create credentials | POST | /users/{leafUserId}/cnhi-credentials |
| Delete credentials | DELETE | /users/{leafUserId}/cnhi-credentials |
| Get credential events | GET | /users/{leafUserId}/cnhi-credentials/events |
Troubleshooting
Use the events endpoint to inspect credential health:- Status changes to invalid: The grower may have revoked access or the refresh token expired. Have the grower re-authorize.
- STAGE vs. PRODUCTION mismatch: Make sure
clientEnvironmentmatches the environment your CNHi app is registered in. - Missing subscription key: CNHi requires a
subscriptionKeyin addition to OAuth credentials. Verify you’re passing it in the request body.
What to do next
- Connect CNHi Tutorial — Step-by-step walkthrough.
- Provider Authentication Overview — How provider credentials work across all providers.
- API Reference: Providers — Full endpoint reference for provider credentials.

