Leaf connects to Trimble Agriculture using OAuth 2.0. Once connected, Leaf syncs growers, farms, fields, machine files, and field operations for the Leaf user.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 Trimble Agriculture developer account. Register here.
- Your application’s
clientIdandclientSecretfrom Trimble. - A grower’s
refreshTokenobtained through the Trimble OAuth 2.0 consent flow.
Setup steps
- Complete the Trimble 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}/trimble-credentials.
Credentials schema
Create request body:| Field | Type | Required | Description |
|---|---|---|---|
clientId | string | Yes | Your application’s client ID from Trimble |
clientSecret | string | Yes | Your application’s client secret |
refreshToken | string | Yes | The grower’s OAuth refresh token |
Endpoints
Base URL:https://api.withleaf.io/services/usermanagement/api
| Action | Method | Path |
|---|---|---|
| Get credentials | GET | /users/{leafUserId}/trimble-credentials |
| Create credentials | POST | /users/{leafUserId}/trimble-credentials |
| Delete credentials | DELETE | /users/{leafUserId}/trimble-credentials |
| Get credential events | GET | /users/{leafUserId}/trimble-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 through Trimble’s OAuth flow.
What to do next
- Connect Trimble Tutorial — Step-by-step walkthrough.
- Provider Authentication Overview — How provider credentials work across all providers.
- API Reference: Providers — Full endpoint reference for provider credentials.

