> ## 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.

# Sync Summary

> Check how many growers, farms, and fields Leaf has synced from each provider for a Leaf user. Verify connections are working and expected data came through.

After you connect a Leaf user to a provider, this endpoint tells you what actually synced. It returns counts of growers, farms, and fields per provider for a given Leaf user, along with the most recent sync timestamp. Use it to verify a new connection is working, confirm that `organizationDataSync` or `customDataSync` settings are producing the expected scope, or troubleshoot why data is missing.

## Base URL

```
https://api.withleaf.io/services/integrations/api
```

## Endpoints

| Endpoint                                                | Method                                                          | Path         |
| ------------------------------------------------------- | --------------------------------------------------------------- | ------------ |
| [Get integration resources](#get-integration-resources) | <span style={{fontWeight: 'bold', color: '#16a34a'}}>GET</span> | `/resources` |

***

## FMIS structure by provider

Each provider organizes farm data with a different hierarchy. The table below shows which structural levels are available from each provider when Leaf syncs resources.

| Provider                    | Grower | Farm | Field |
| --------------------------- | ------ | ---- | ----- |
| John Deere                  | ✓      | ✓    | ✓     |
| Climate FieldView           | ✗      | ✓    | ✓     |
| CNHI (AFS Connect - Legacy) | ✓      | ✓    | ✓     |
| CNHI FieldOps               | ✓      | ✓    | ✓     |
| Trimble                     | ✓      | ✓    | ✓     |
| Stara                       | ✗      | ✗    | ✓     |
| Raven                       | ✓      | ✓    | ✓     |
| AgVance                     | ✓      | ✓    | ✓     |
| Sentera                     | ✗      | ✗    | ✓     |

<Info>Climate FieldView does not expose a grower-level entity. Stara only provides field-level data.</Info>

***

## Get integration resources

<span style={{fontWeight: 'bold', color: '#16a34a'}}>GET</span> `/resources`

Returns summaries of synced resources per provider for the authenticated API owner, optionally filtered by Leaf user and/or provider. The response includes counts of growers, farms, and fields along with the most recent sync reference time.

### Parameters

| Parameter    | Type          | Description                                                                                                                           |
| ------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `provider`   | string        | Filter by provider name (`JohnDeere`, `ClimateFieldView`, `CNHI`, `CNHIFieldOps`, `Trimble`, `Stara`, `Raven`, `AgVance`, `Sentera`). |
| `leafUserId` | string (UUID) | Filter by Leaf user.                                                                                                                  |

### Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    'https://api.withleaf.io/services/integrations/api/resources?leafUserId=UUID'
  ```

  ```python Python theme={null}
  import requests

  TOKEN = "YOUR_TOKEN"
  endpoint = "https://api.withleaf.io/services/integrations/api/resources"
  headers = {"Authorization": f"Bearer {TOKEN}"}
  params = {"leafUserId": "UUID"}

  response = requests.get(endpoint, headers=headers, params=params)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const axios = require('axios')
  const TOKEN = 'YOUR_TOKEN'

  const endpoint = 'https://api.withleaf.io/services/integrations/api/resources'
  const headers = { Authorization: `Bearer ${TOKEN}` }
  const params = { leafUserId: 'UUID' }

  axios.get(endpoint, { headers, params })
    .then(res => console.log(res.data))
    .catch(console.error)
  ```
</CodeGroup>

### Response

```json theme={null}
{
  "message": "SUCCESS",
  "summaries": [
    {
      "provider": "JohnDeere",
      "leafUserId": "7494c90e-28b8-4bb2-9ede-95c1cc894349",
      "growers": 12,
      "farms": 12,
      "fields": 100,
      "syncReferenceTime": "2023-08-30T18:39:33.230612Z"
    }
  ]
}
```

<Tip>Use the `provider` parameter to compare resource counts across providers for a single Leaf user, or omit it to see all providers at once.</Tip>
