API Documentation

Verdant's REST API gives you full programmatic access to plant data, sensor history, AI logs, and actuator control. All treasury data is publicly verifiable on Solana.

🌐 Base URL: https://api.verdant.io/v1 — All endpoints use HTTPS and return JSON.
On-chain: Sensor logs and treasury transactions are recorded on Solana. Verify anytime on solana.fm or explorer.solana.com.

🔑 Authentication

All API requests require an API key sent via the Authorization header.

HTTP Header
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Get your API key from Settings → API Keys in your Verdant dashboard.

⚡ Rate Limits

Tier
Req / min
Req / day
Free
60
10,000
Starter
300
100,000
Pro
1,000
Unlimited

🌱 Plants API

GET/plantsList all plants

Returns all plants connected to your account.

Response 200
{
  "plants": [{
    "id": "plant_abc123",
    "name": "Cherry Tomato",
    "species": "Solanum lycopersicum",
    "growth_stage": "vegetative",
    "status": "healthy",
    "onchain_log": "https://solana.fm/address/..."
  }],
  "total": 1
}
POST/plantsAdd a new plant
ParameterTypeDescription
namerequiredstringYour plant's name
speciesoptionalstringScientific species name
growth_stageoptionalstringseedling, vegetative, flowering, fruiting
care_presetoptionalstringtropical, temperate, desert, mediterranean
GET/plants/{id}Plant details

Returns full plant details including MQTT config, care thresholds, and on-chain log address.

DELETE/plants/{id}Delete plant
⚠️ Permanent. Deletes all associated sensor data and care logs. On-chain records remain permanently.

📊 Sensor Data

GET/plants/{id}/sensorsSensor history
Query ParamTypeDefault
fromISO 860124 hours ago
toISO 8601Now
intervalstringraw — or: 5m, 15m, 1h, 1d
limitinteger100 (max: 1000)
POST/plants/{id}/sensorsSubmit sensor data

HTTP alternative to MQTT — useful for testing or non-broker integrations.

Request Body
{
  "temperature": 22.5,
  "humidity": 65,
  "soilMoisture": 45,
  "lightLevel": 3500
}

🎮 Actions

POST/plants/{id}/actionsSend hardware command
ParameterTypeDescription
actionrequiredstringwater, light_on, light_off, fan_on, fan_off, heater_on, heater_off
durationoptionalintegerDuration in seconds
leveloptionalintegerIntensity 0–100 for dimmers

🧠 AI Analysis

POST/plants/{id}/analyzeTrigger manual AI analysis

Forces an immediate AI analysis using the latest sensor data, bypassing the automatic interval.

Response 200
{
  "analysis_id": "anlz_xyz789",
  "actions_taken": ["water", "light_adjust"],
  "reasoning": "Soil moisture 28% below threshold 35%...",
  "onchain_tx": "5XnJk...7fPq",
  "next_analysis": "2025-03-18T14:00:00Z"
}
GET/plants/{id}/analysisAI analysis history

Returns historical AI decision logs including reasoning, actions taken, and on-chain transaction IDs for verification.

📋 Care Logs

GET/plants/{id}/logsFull care timeline

Complete timeline of all events: waterings, light adjustments, growth stage changes, and AI notifications — all with on-chain references.

⬡ Treasury API

All treasury data is publicly available on-chain. These endpoints are convenience wrappers around Solana data.

Treasury Wallet

All $VRDT trading fees flow into a Squads Protocol multisig. Balance, inflows, and outflows are publicly verifiable. Use the endpoints below or query Solana directly.

GET/treasuryTreasury overview
Response 200
{
  "balance_usdc": 42850.00,
  "balance_vrdt": 1200000,
  "monthly_inflow": 8400.00,
  "monthly_spend": {
    "ai_ops": 3360.00,
    "rnd": 2520.00,
    "marketing": 1680.00,
    "reserve": 840.00
  },
  "wallet_address": "VRDTxyz...abc",
  "solana_explorer": "https://solana.fm/address/VRDTxyz..."
}
GET/treasury/transactionsTransaction history

Paginated list of all treasury inflows (trading fees) and outflows (ops spending) with Solana transaction signatures.

🔔 Webhooks

Verdant sends real-time events to your endpoint URL whenever something happens in the network.

POST /webhooks
{
  "url": "https://yourapp.com/verdant-webhook",
  "events": ["sensor.low_moisture", "action.taken", "ai.analysis_complete", "treasury.inflow"],
  "plant_id": "plant_abc123"
}
sensor.low_moistureSoil dropped below threshold
"event": "sensor.low_moisture", "value": 18, "threshold": 35
action.takenAI executed a care action
"event": "action.taken", "action": "water", "onchain_tx": "5XnJ..."
treasury.inflowTrading fee received
"event": "treasury.inflow", "amount_usdc": 142.50, "tx": "9Kqm..."

📡 MQTT Reference

Complete reference of all MQTT topics used by Verdant hardware nodes.

TopicDirectionDescription
verdant/{id}/sensorsPublish ↑Send sensor readings (JSON, every 30s)
verdant/{id}/actionsSubscribe ↓Receive AI action commands
verdant/{id}/statusSubscribe ↓Connection & health status updates
verdant/{id}/cameraPublish ↑Camera frame stream (JPEG bytes)