Skip to main content
Leaf connects to Precision Planting Panorama using OAuth 2.0 via AWS Cognito. Once connected, Leaf syncs growers, farms, fields, machine files, and field operations.
The recommended way to create Panorama credentials is through the one-click integration endpoint: POST /users/{leafUserId}/one-click-integration/Panorama. This handles the Cognito token exchange and sharing handshake automatically.

Prerequisites

  1. A Precision Planting Panorama developer/partner account.
  2. Your application’s clientId from the Panorama developer portal.
  3. The grower’s username, password, and organizationCode from their Panorama account.
  4. A refreshToken obtained through the Cognito authentication flow, or use the one-click integration endpoint which handles this for you.

Setup steps

Option A: One-click integration (recommended) Use the one-click integration endpoint, which handles the Cognito token exchange automatically:
POST /users/{leafUserId}/one-click-integration/Panorama
Option B: Manual credential creation If you manage the Cognito flow yourself, POST the credentials to Leaf:
curl -X POST \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Content-Type: application/json' \
    -d '{
      "clientId": "your-client-id",
      "username": "grower-username",
      "password": "grower-password",
      "organizationCode": "grower-org-code",
      "refreshToken": "cognito-refresh-token",
      "clientEnvironment": "PRODUCTION"
    }' \
    'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/panorama-credentials'

Confirm the credentials are attached

Check the stored credentials for the Leaf user:
curl "https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/panorama-credentials" \
  -H "Authorization: Bearer YOUR_TOKEN"
If this worked, Leaf returns the Panorama credential object for the Leaf user.

Credentials schema

Create request body:
FieldTypeRequiredDescription
clientIdstringYesYour application’s client ID from Panorama
usernamestringYesThe grower’s Panorama username
passwordstringYesThe grower’s Panorama password
organizationCodestringYesThe grower’s organization code in Panorama
refreshTokenstringYesCognito refresh token
clientEnvironmentstringYesSTAGE or PRODUCTION
Response:
{
  "id": "uuid",
  "status": "str",
  "createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'",
  "clientId": "str",
  "username": "str",
  "organizationCode": "str",
  "clientEnvironment": "PRODUCTION",
  "accessToken": "str",
  "refreshToken": "str"
}

Endpoints

Base URL: https://api.withleaf.io/services/usermanagement/api
ActionMethodPath
Get credentialsGET/users/{leafUserId}/panorama-credentials
Create credentialsPOST/users/{leafUserId}/panorama-credentials
Delete credentialsDELETE/users/{leafUserId}/panorama-credentials
Get credential eventsGET/users/{leafUserId}/panorama-credentials/events

Troubleshooting

Use the events endpoint to inspect credential health:
curl -X GET \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/panorama-credentials/events'
Event logs are retained for 30 days. Once the credential is deleted or disassociated from the Leaf user, the logs are no longer available.
Common issues:
  • Cognito token expiry: Panorama uses AWS Cognito for auth. If the credential becomes invalid, the grower may need to re-authenticate. Using the one-click integration endpoint avoids much of this complexity.
  • Wrong organization code: Verify the organizationCode matches the grower’s Panorama account exactly.
  • STAGE vs. PRODUCTION mismatch: Make sure clientEnvironment matches your Panorama setup.

What to do next

Last modified on March 19, 2026