Interactive OpenAPI Definition

The PlantCare Enterprise interface relies on an OpenAPI (Swagger) design allowing businesses to directly ingest our highly accurate predictive modeling engine.

swagger.yaml /v1/analyses/sync /v1/history /v1/stats /v1/iot/devices

Interactive API docs: OpenAPI Specification · Download: openapi.yaml

Image Optimization

To ensure high throughput and reduce payload size, incoming agricultural photos are automatically pre-processed at the API Gateway:

  • WebP Compression: Converted to WebP format at Quality 92.
  • Max Resolution: Resized to 1024x1024px, preserving aspect ratio.
  • Private Network: Optimization and analysis run entirely inside VPC boundaries.

Security & Compliance

Our API enforces top-tier compliance standards to isolate telemetry and protect crop data access:

  • Keyless Security: Authenticates via Workload Identity Federation (WIF).
  • Malware Scans: Payload photos scanned for malware signatures at gateway entry.
  • Detailed Guide: Review our Zero-Trust Security & Auth Model.

B2B Ingestion Workflow

sequenceDiagram participant Client as "Enterprise / Mobile Client" participant API as "API Gateway" participant GCS as "Object Storage" participant Scan as "Malware Scanner" participant Proc as "Image Processor" participant AI as "AI Engine" Client->>API: "POST /v1/analyses/sync (Authorization: Bearer pk_ent_...)" Note over API: "Auto-detect input method" API->>GCS: "Upload Raw Image (if Base64)" Note over GCS,Scan: "GCS Trigger: scanNewFile" Scan->>Scan: "Scan Image for Malware" API->>Proc: "Request Optimization (Signed Token Auth)" Proc-->>API: "Optimized Image URL" API->>AI: "Analyze with Optimized Image + Language" AI-->>API: "Analysis Results" API-->>Client: "JSON Result (Diagnosis + Image Path)"

Sync Diagnostic Quickstart

Send a synchronous POST query with base64 encoded photo and location indicators to execute model evaluation:

curl -X POST https://api.plantcare.farm/v1/analyses/sync \
  -H "Authorization: Bearer pk_ent_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "imageBase64": "...",
    "sunExposure": "Full Sun",
    "latitude": 40.7128,
    "longitude": -74.0060,
    "placement": "outside",
    "language": "en"
  }'

Transaction Idempotency Guard

To prevent duplicate analysis executions, protect your daily quotas, and guard against network retry race conditions, the PlantCare API supports client-defined idempotency keys.

Idempotency-Key
UUID v4 standard string
24-hour result retention

Include the header in write-based analysis requests (such as asynchronous creation at /v0/analysis/start or /v1/analyses):

curl -X POST https://api.plantcare.farm/v0/analysis/start \
  -H "Authorization: Bearer pk_ent_your_token_here" \
  -H "Idempotency-Key: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d" \
  -H "Content-Type: application/json" \
  -d '{
    "imageBase64": "..."
  }'

Duplicate Result Behaviors:
Completed Transactions: Instantly returns the cached analysis result without charging additional quota or executing GenAI inference.
Pending Transactions: Returns 202 Accepted along with the existing transaction ID, preventing duplicate processes.


Need architecture details? Check out our Architecture & Scalability Guide. Need access? Please contact our Sales Team.