Skip to main content

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.

Leaf connects to Valley irrigation systems using API credentials. Once connected, Leaf syncs irrigation activity data for the Leaf user.

Prerequisites

  1. A Valley account with API access.
  2. Your Valley API credentials: apid, initializationVector, key, username, and password.

Credentials schema

FieldTypeRequiredDescription
apidstringYesYour Valley application ID.
initializationVectorstringYesInitialization vector for API authentication.
keystringYesAPI key.
usernamestringYesValley account username.
passwordstringYesValley account password.

Endpoints

MethodPathDescription
GET/users/{leafUserId}/valley-credentialsGet stored credentials.
POST/users/{leafUserId}/valley-credentialsCreate credentials.
DELETE/users/{leafUserId}/valley-credentialsDelete credentials.
GET/users/{leafUserId}/valley-credentials/eventsGet credential events for troubleshooting.
Base URL: https://api.withleaf.io/services/usermanagement/api

Create credentials

curl -X POST \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "apid": "your-apid",
    "initializationVector": "your-iv",
    "key": "your-key",
    "username": "your-username",
    "password": "your-password"
  }' \
  'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/valley-credentials'

Response

{
  "id": "uuid",
  "status": "OK",
  "createdTime": "2026-01-15T12:00:00.000000Z",
  "apid": "your-apid",
  "key": "your-key",
  "initializationVector": "your-iv",
  "username": "your-username"
}

Troubleshooting

Use the events endpoint to check credential health. Events are retained for 30 days and are deleted when the credential is removed.
GET /users/{leafUserId}/valley-credentials/events

What to do next

Last modified on March 19, 2026