API Documentation
Interactive OpenAPI Definition
The PlantCare Enterprise interface relies on an OpenAPI (Swagger) design allowing businesses to directly ingest our highly accurate predictive modeling engine.
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
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.
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.