Use these endpoints to list provider organizations for a Leaf user and, for John Deere, to control which organizations Leaf processes. For behavior, status meanings, and organizationDataSync, see Provider Organizations.
Base URL
https://api.withleaf.io/services/usermanagement/api
Endpoints
Provider organization list
Returns connected and not-connected organizations for a provider account when the provider supports that distinction.
| Action | Method | Path |
|---|
| List organizations for a provider | GET | /users/{leafUserId}/organizations/{provider} |
- Supported
{provider} values include JohnDeere and Trimble.
- John Deere returns both
connectedOrganizations and notConnectedOrganizations.
- Trimble does not distinguish connected vs not connected in the same way.
Provider organization sync management
These paths control which organizations Leaf is allowed to process for a connected account.
Sync-management operations in this group are John Deere only. Use {provider} = JohnDeere.
| Action | Method | Path |
|---|
| List provider organizations | GET | /users/{leafUserId}/{provider}/organizations |
| Get one provider organization | GET | /users/{leafUserId}/{provider}/organizations/{providerOrgId} |
| Update organization status | PATCH | /users/{leafUserId}/{provider}/organizations/{providerOrgId}/{status} |
| Sync provider organizations | POST | /users/{leafUserId}/{provider}/organizations/sync |
Example: organization list response
{
"connectedOrganizations": [
{
"id": "organization_id_1",
"name": "Organization Name 1",
"managementUri": "https://connections.deere.com/connections/clientKey/connections-dialog?orgId=organization_id_1"
}
],
"notConnectedOrganizations": [
{
"id": "organization_id_2",
"name": "Organization Name 2",
"managementUri": "https://connections.deere.com/connections/clientKey/connections-dialog?orgId=organization_id_2"
}
]
}
Example: GET organization list
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/organizations/JohnDeere'
Provider organization resource
{
"providerOrgId": "520674381",
"providerOrgName": "Leaf Farms",
"status": "SELECTED",
"managementUri": "https://connections.deere.com/connections/clientKey/connections-dialog?orgId=Leaf Farms"
}
| Field | Description |
|---|
providerOrgId | Provider organization ID |
providerOrgName | Provider organization name |
managementUri | Provider URL to review or fix the app-to-organization connection |
status | Whether Leaf processes data from this organization (SELECTED, PREVIEW, BLOCKED) |
Organization statuses
| Status | Meaning |
|---|
SELECTED | Leaf processes resources from this organization. |
PREVIEW | Visible to Leaf but downstream resources are not processed. |
BLOCKED | The app lacks required provider-side access for this organization. |
If a John Deere managementUri contains connections-dialog, the connection is established. If it contains select-organizations, setup is incomplete until you fix the provider-side connection and run a sync again.
Sync scope configuration
organizationDataSync on the Leaf user configuration controls whether Leaf syncs every available organization or only those you mark SELECTED:
ALL — sync every organization the account can access.
SELECTED_ONLY — sync only organizations you set to SELECTED via these endpoints.
See Configuration and Provider Organizations for details and billing implications.
Verify synced resources
Confirm grower, farm, and field counts after changing organization scope:
GET https://api.withleaf.io/services/integrations/api/resources
See Integrations.
What to do next