Skip to main content

API Reference

Eyesotope provides a RESTful API for programmatic access to your farm data. This section provides an overview of the API structure.
Full interactive API documentation with request/response examples is coming soon. This page provides a structural overview.

Base URL

https://api.eyesotope.com/api/v1/

Authentication

The API uses token-based authentication. Include your token in the Authorization header:
curl -H "Authorization: Token YOUR_API_TOKEN" \
     https://api.eyesotope.com/api/v1/fields/

Endpoints Overview

All farm-scoped endpoints require the X-Farm-ID header with your farm UUID.

Core Resources

EndpointMethodsDescription
/api/v1/farms/GET, POSTList/create farms
/api/v1/farms/{id}/GET, PUT, DELETEFarm detail
/api/v1/farms/{id}/members/GET, POSTFarm members
/api/v1/fields/GET, POSTList/create fields
/api/v1/fields/{id}/GET, PUT, DELETEField detail
/api/v1/seasons/GET, POSTList/create seasons
/api/v1/inventory/products/GET, POSTInventory products
/api/v1/equipment/GET, POSTEquipment list
/api/v1/operations/GET, POSTOperations
/api/v1/partners/GET, POSTPartners
/api/v1/contracts/GET, POSTContracts
/api/v1/deliveries/GET, POSTDeliveries
/api/v1/leases/GET, POSTLeases

Agriculture & Crop Data

EndpointMethodsDescription
/api/v1/crop-types/GETGlobal crop type reference library
/api/v1/phenology-stages/GETGrowth stage definitions (BBCH scale)
/api/v1/farms/{id}/agriculture-years/GET, POSTSeasons (agriculture years)
/api/v1/farms/{id}/agriculture-years/{yr}/crops/GET, POSTCrops within a season
/api/v1/farms/{id}/agriculture-years/{yr}/crops/{c}/varieties/GET, POSTCrop varieties

Satellite & Remote Sensing

EndpointMethodsDescription
/api/v1/farms/{f}/fields/{fd}/satellite/GET, POSTSatellite monitoring data / activate monitoring
/api/v1/farms/{f}/fields/{fd}/satellite/images/bulk-toggle-visibility/POSTBulk archive/restore satellite images
/api/v1/farms/{f}/fields/{fd}/satellite/images/{img}/proxy/{index}/GETProxy satellite image (serves PNG for map overlays)
/api/v1/farms/{f}/satellite-overlays/GETSatellite imagery overlays for all fields
/api/v1/farms/{f}/satellite-overlay-dates/GETAvailable satellite imagery dates
/api/v1/farms/{f}/field-previews/GETBatch field preview images
/api/v1/farms/{f}/field-rankings/GETField rankings by EVI and health scores
/api/v1/farms/{f}/rainfall-by-location/GETRainfall data by location
/api/v1/farms/{f}/soil-moisture-by-location/GETSoil moisture data by location

Climate Intelligence (NASA POWER)

EndpointMethodsDescription
/api/v1/farms/{f}/fields/{fd}/satellite/climate-intelligence/GET28 NASA POWER channels + derived metrics
/api/v1/farms/{f}/fields/{fd}/satellite/climate-history/GETHistorical climate metrics
/api/v1/farms/{f}/fields/{fd}/satellite/climate-raw/GETRaw NASA POWER data for a field
/api/v1/farms/{f}/fields/{fd}/satellite/climate-sync/POSTTrigger climate data synchronization
/api/v1/farms/{f}/climate-points/GET, POSTClimate observation points for farm-level analysis
/api/v1/farms/{f}/climate-points/{p}/historical/GET44-year historical climate data for a point
/api/v1/farms/{f}/climate-points/{p}/heatmap/GETMonthly heatmap data (year × month grid)
/api/v1/farms/{f}/climate-points/{p}/advanced-stats/GETGrowing season shifts, drought probability
/api/v1/farms/{f}/climate-points/{p}/crop-suitability/GETCrop suitability scoring (6 crops, 5 factors)
/api/v1/farms/{f}/climate-points/{p}/extreme-events/GETExtreme event detection with trend analysis
/api/v1/farms/{f}/climate-points/{p}/climate-records/GETAll-time climate records
/api/v1/farms/{f}/climate-points/{p}/rainfall-analysis/GETSPI drought index and rainfall decomposition
/api/v1/farms/{f}/climate-points/compare/GETMulti-point comparison data

Crop Intelligence

EndpointMethodsDescription
/api/v1/farms/{f}/fields/{fd}/satellite/water-balance/GETFAO Penman-Monteith water balance
/api/v1/farms/{f}/fields/{fd}/satellite/yield-potential/GETYield estimation (3 FAO methods)
/api/v1/farms/{f}/fields/{fd}/satellite/yield-estimates/GETPersisted yield estimate records
/api/v1/farms/{f}/fields/{fd}/satellite/water-balance-summaries/GETPersisted water balance summaries
/api/v1/farms/{f}/yield-estimates/GETAll yield estimates for a farm (cross-field)
/api/v1/farms/{f}/water-balance-summaries/GETAll water balance summaries for a farm

AI Assistant

EndpointMethodsDescription
/api/v1/farms/{f}/ai/chat/POSTSend a message, receive an AI response
/api/v1/farms/{f}/ai/chat/stream/POSTSSE streaming chat — real-time token-by-token response with tool events
/api/v1/farms/{f}/ai/upload/POSTUpload a file (image/PDF/text/CSV) for AI chat analysis
/api/v1/farms/{f}/ai/conversations/GETList user’s conversations for this farm
/api/v1/farms/{f}/ai/conversations/{id}/GET, DELETEConversation detail with messages / soft-delete
/api/v1/farms/{f}/ai/tasks/GETList AI agent tasks (last 100)
/api/v1/farms/{f}/ai/tasks/{id}/GETTask detail (status, tokens, cost, tools used)
/api/v1/farms/{f}/ai/credits/GETCredit wallet balance
/api/v1/farms/{f}/ai/credits/transactions/GETCredit usage ledger
/api/v1/ai/agents/GETList all active agent types
/api/v1/ai/pricing/GETActive credit pricing tiers

Streaming Chat (SSE)

The streaming endpoint (/ai/chat/stream/) returns a text/event-stream response with the following event types:
EventDescription
startStream started — includes conversation_id
tokenA text token to append to the response
tool_startAn AI tool began executing (includes tool name)
tool_endA tool finished (includes latency and success status)
warningNon-fatal warning (e.g., provider fallback)
reasoning_startDeep reasoning stage began (includes model name)
reasoning_deltaReasoning content signal (clear: true means replace Stage 1 output)
reasoning_endDeep reasoning completed
doneStream complete — includes full metadata (model, tokens, cost, tools, duration)
errorAn error occurred

Chat Request Fields

FieldTypeRequiredDescription
messagestringYesThe user’s message
conversation_idUUIDNoContinue an existing conversation
agent_typestringNoAgent type slug (e.g., chat-assistant)
contextarrayNo@mention references: [{type, id, label}]
web_researchbooleanNoEnable web search for additional context
reasoningbooleanNoEnable two-stage deep reasoning pipeline
attachmentsarrayNoList of upload UUIDs from /ai/upload/

File Upload

The upload endpoint (/ai/upload/) accepts multipart file uploads with the following constraints:
  • Supported formats — JPEG, PNG, WebP, GIF, PDF, TXT, CSV
  • Max file size — 10 MB
  • Rate limit — 10 uploads per minute
  • Security — MIME type validated via magic bytes, filenames sanitized, image decompression bomb protection, PDF page limit (200 pages)

Billing & Subscriptions

EndpointMethodsDescription
/api/v1/billing/plans/GETAvailable subscription plans
/api/v1/billing/packages/credits/GETAvailable credit packages
/api/v1/billing/packages/seats/GETAvailable seat packages
/api/v1/farms/{f}/billing/subscription/GETCurrent subscription details
/api/v1/farms/{f}/billing/wallet/GETAI credit wallet balance
/api/v1/farms/{f}/billing/wallet/ledger/GETCredit usage history
/api/v1/farms/{f}/billing/seats/ledger/GETSeat changes history
/api/v1/farms/{f}/billing/usage/GETResource usage vs. plan limits
/api/v1/farms/{f}/billing/checkout/plan/POSTCreate Stripe Checkout for plan
/api/v1/farms/{f}/billing/checkout/credits/POSTCreate Stripe Checkout for credits
/api/v1/farms/{f}/billing/checkout/seats/POSTCreate Stripe Checkout for seats
/api/v1/farms/{f}/billing/change-plan/POSTInstant plan change (proration)
/api/v1/farms/{f}/billing/cancel/POSTCancel subscription
/api/v1/farms/{f}/billing/resume/POSTResume cancelled subscription
/api/v1/farms/{f}/billing/portal/POSTGet Stripe Customer Portal URL
/api/v1/farms/{f}/billing/invoices/GETInvoice history

Role-Based Access

API endpoints enforce the same role-based permissions as the web interface:
  • GET requests — Available to all authenticated members
  • POST, PUT, PATCH — Requires Operator role or above
  • DELETE — Requires Manager role or above
  • Viewers receive a 403 Forbidden response for write operations

Authentication & Account

EndpointMethodsDescription
/auth/login/POSTLogin with email/password (supports remember_me flag)
/auth/registration/POSTRegister a new account
/auth/google/POSTGoogle OAuth login/registration
/auth/password/reset/POSTRequest a password reset email
/auth/password/reset/confirm/POSTSet a new password with UID/token
/auth/registration/verify-email/POSTVerify email with confirmation key
/auth/token/verify/POSTVerify if a token is still valid
/auth/token/refresh/POSTRefresh an authentication token
/auth/logout/POSTLogout (blacklists the current token)
/auth/totp/create/POSTGenerate TOTP QR code and secret
/auth/totp/login/POSTVerify TOTP code during login
/auth/totp/GETCheck TOTP 2FA status

Notifications

EndpointMethodsDescription
/api/v1/notifications/GETList notifications (paginated)
/api/v1/notifications/unread-count/GETGet count of unread notifications
/api/v1/notifications/{id}/read/POSTMark a single notification as read
/api/v1/notifications/mark-all-read/POSTMark all notifications as read
wss://*/ws/notifications/WebSocketReal-time notification stream

Archive

EndpointMethodsDescription
/api/v1/farms/{f}/archive/GETList all archived items across all types
/api/v1/farms/{f}/archive/POSTArchive an item (type + ID)
/api/v1/farms/{f}/unarchive/POSTRestore an archived item

Activity Log

EndpointMethodsDescription
/api/v1/farms/{f}/activity/GETFull audit trail of all farm actions

Response Format

All responses are in JSON format. List endpoints support pagination:
{
  "count": 42,
  "next": "https://api.eyesotope.com/api/v1/fields/?page=2",
  "previous": null,
  "results": [...]
}

Error Responses

Status CodeMeaning
400Bad Request — Invalid input data
401Unauthorized — Missing or invalid token
403Forbidden — Insufficient permissions (role or module)
404Not Found — Resource doesn’t exist
429Too Many Requests — Rate limit exceeded
500Server Error — Contact support

Rate Limiting

The API enforces rate limiting to ensure fair usage:
  • Authenticated requests — Throttled per user
  • Anonymous requests — Throttled per IP address
  • Rate limit headers are included in responses: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
When rate limited, the API returns a 429 Too Many Requests response with a Retry-After header.