Leaf connects to Stara using an API key combined with OAuth tokens. Once connected, Leaf syncs fields, machine files, and field operations. Stara’s FMIS structure exposes fields only (no separate grower or farm hierarchy).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 Stara developer/partner account with API access.
- Your
apiKeyfrom Stara. - The grower’s
accessToken,accessTokenClient, andrefreshTokenfrom the Stara authentication flow.
Setup steps
POST the credentials to Leaf:Credentials schema
Create request body:| Field | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Your Stara API key |
accessToken | string | Yes | The grower’s access token |
accessTokenClient | string | Yes | The grower’s client access token |
refreshToken | string | Yes | The grower’s refresh token |
Endpoints
Base URL:https://api.withleaf.io/services/usermanagement/api
| Action | Method | Path |
|---|---|---|
| Get credentials | GET | /users/{leafUserId}/stara-credentials |
| Create credentials | POST | /users/{leafUserId}/stara-credentials |
| Delete credentials | DELETE | /users/{leafUserId}/stara-credentials |
| Get credential events | GET | /users/{leafUserId}/stara-credentials/events |
Troubleshooting
Use the events endpoint to inspect credential health:- No grower/farm hierarchy: Stara only exposes fields. If you expect grower or farm-level data, it won’t be available from this provider.
- Status changes to invalid: Tokens may have expired. Re-authenticate the grower through Stara.
What to do next
- Connect Stara Tutorial — Step-by-step walkthrough.
- Provider Authentication Overview — How provider credentials work across all providers.
- API Reference: Providers — Full endpoint reference for provider credentials.

