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.
This tutorial walks through connecting Stara’s telemetry platform to Leaf. You’ll get developer credentials from Stara, obtain API tokens, and attach them to a Leaf user. Stara provides field names, field boundaries, planting operations, as-applied operations, and machine information.
Magic Link and Leaf Link can handle Stara authentication for you. This tutorial covers the manual API flow.
Before you start
- A Leaf account with a valid API token.
- A Leaf user created.
- A Stara developer account. Contact Stara at servicos@stara.com.br or +55 054 99706-7292 to request API access. They’ll provide a username and password.
Step 1: Get your API key
Authenticate with Stara to get an API key:
curl -X POST "https://v2apitelemetria.telemetriastara.com.br/autenticacao" \
-H "Content-Type: application/json" \
-d '{
"login": "your-stara-username",
"password": "your-stara-password"
}'
Step 2: Get access and refresh tokens
Use the API key to generate tokens:
curl -X POST "https://v2apitelemetria.telemetriastara.com.br/token" \
-H "Content-Type: application/json" \
-d '{
"apiKey": "your-stara-api-key"
}'
Step 3: Attach credentials to the Leaf user
curl -X POST "https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/stara-credentials" \
-H "Authorization: Bearer YOUR_LEAF_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"apiKey": "the-api-key-from-step-1",
"accessToken": "the-access-token-from-step-2",
"accessTokenClient": "the-access-token-client-from-step-2",
"refreshToken": "the-refresh-token-from-step-2"
}'
Leaf manages token refresh automatically and begins syncing data.
Step 4: Confirm the credentials are attached
Check the stored credentials for the Leaf user:
curl "https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/stara-credentials" \
-H "Authorization: Bearer YOUR_LEAF_TOKEN"
If this worked, Leaf returns the Stara credential object with apiKey, accessToken, accessTokenClient, and refreshToken.
What you built
You connected Stara Telemetry to a Leaf user. Leaf now syncs field names, boundaries, planting, and application data from Stara. Query the data through the field operations quickstart.
If you don’t have field boundaries set up yet, start with the fields overview and uploading boundaries docs.
For the credentials schema and management endpoints, see the Stara provider guide and the provider credentials API reference.