Prerequisites
- OAuth client credentials (
clientKeyandclientSecret) for the CLAAS partner/OFT API. - A grower’s
refreshTokenobtained through the CLAAS OAuth 2.0 consent flow.
Setup steps
- Complete the CLAAS OAuth 2.0 flow to obtain a
refreshTokenfor the grower’s account. - POST the credentials to Leaf:
- Leaf validates the credentials and begins syncing. Check credential status with
GET /users/{leafUserId}/claas-credentials.
Credentials schema
Create request body:
Response:
Endpoints
Base URL:https://api.withleaf.io/services/usermanagement/api
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 the CLAAS OAuth flow.
- STAGE vs. PRODUCTION mismatch: Make sure
clientEnvironmentmatches the environment your CLAAS app is registered in. If omitted, Leaf defaults toSTAGE.
What to do next
- Provider Authentication Overview — How provider credentials work across all providers.
- API Reference: Providers — Full endpoint reference for provider credentials.

