Docs
Every call goes through the gateway with the farm's API key.
| Environment | Base URL |
|---|---|
| Production | https://api-prod.nextfarm.vn |
Quickstart
From zero to your first API call in 5 steps — farm owners or partners.
API keys and scopes
Headers, 22 scopes, safety limits, error codes.
Webhooks
3 events, sample payload, signature verification, retry schedule.
MCP for AI assistants
Connect any AI assistant, 32 tools (read-only).
Security
Credentials, least privilege, HMAC-SHA256 signatures, HTTPS, key rotation, vulnerability reports.
Apps & OAuth
Software for many farms: create an app, the install link returns a code, Test Console, Publish.
Error codes
HTTP statuses, error codes, causes and fixes.
Rate limit
600 calls/minute per app × farm / API key, X-RateLimit-*, 429.
API reference — 146 operations
/api/v1/gisParcels, zones, farmers, seasons, map layers — the farm's spatial data foundation.
- GET/api/v1/gis/care-schedules— Care schedule triggers (filter by parcel)
- GET/api/v1/gis/care-schedules/preview— Preview the schedule (writes nothing)
- GET/api/v1/gis/care-schedules/this-week— This week's care tasks (ENABLED triggers only)
- GET/api/v1/gis/care-schedules/{id}/calendar— Full-year schedule of a trigger
- GET/api/v1/gis/care-schedules/{id}/generations— Generated history of a trigger
- GET/api/v1/gis/crop-types— List crop types
- GET/api/v1/gis/crop-types/{id}— Get a crop type by ID
- GET/api/v1/gis/crop-types/{id}/perennial-profile— Perennial crop profile of a species
- GET/api/v1/gis/crop-types/{id}/varieties— Varieties and rootstocks of a species
- GET/api/v1/gis/facilities— List livestock facilities
- GET/api/v1/gis/facilities/{id}— Get a livestock facility
- GET/api/v1/gis/farmer-groups— GET /api/v1/gis/farmer-groups
- GET/api/v1/gis/farmers— List farmers
- GET/api/v1/gis/farmers/{id}— Get a farmer
- GET/api/v1/gis/layers— Danh sách map layers
- GET/api/v1/gis/layers/{id}— Get a map layer
- GET/api/v1/gis/map/points— Lightweight points by bbox: farmer homes + parcel centroids
- GET/api/v1/gis/parcels— List parcels
- GET/api/v1/gis/parcels/summary— Parcel area summary by household / zone / crop
- GET/api/v1/gis/parcels/{id}— Get a parcel
- GET/api/v1/gis/parcels/{id}/contains-point— Check whether a GPS point is inside a parcel boundary
- GET/api/v1/gis/parcels/{id}/history— Parcel change history
- GET/api/v1/gis/parcels/{parcelId}/photos— List photos of a parcel
- GET/api/v1/gis/plots— List plots of a parcel
- GET/api/v1/gis/plots/{id}/crops— Species planted in the plot (intercropping)
- GET/api/v1/gis/search— Search parcels, seasons, farmers, zones
- GET/api/v1/gis/season-templates— List process templates
- GET/api/v1/gis/season-templates/{id}— Get a process template
- GET/api/v1/gis/seasons— List seasons
- GET/api/v1/gis/seasons/groups— Season groups of a year (same crop, same season name)
- GET/api/v1/gis/seasons/{id}— Get a season by ID
- GET/api/v1/gis/zones— Danh sách zones
- GET/api/v1/gis/zones/{id}— Get a zone
- GET/api/v1/gis/zones/{id}/stats— Zone statistics
/api/v1/iotDevices, sensor readings, alerts, irrigation schedules. API keys have no device-control API.
- GET/api/v1/iot/alert-rules— List alert rules
- GET/api/v1/iot/alerts— List alerts
- GET/api/v1/iot/commands— List device commands
- GET/api/v1/iot/devices— List IoT devices
- GET/api/v1/iot/devices/control-states— Control status of multiple devices (multi-house screen)
- GET/api/v1/iot/devices/{deviceId}/control-state— Actual control status of a device
- GET/api/v1/iot/devices/{deviceId}/display-prefs— GET /api/v1/iot/devices/{deviceId}/display-prefs
- GET/api/v1/iot/devices/{deviceId}/fert-meters— Fertilizer tank meters: port, board factor in use, and latest raw pulse count
- GET/api/v1/iot/devices/{deviceId}/output-config/channels— List configured output channels (reads the copy persisted by the backend from the dev_cfg echo — independent of realtime)
- GET/api/v1/iot/devices/{deviceId}/output-config/irrigation— Assigned irrigation system configuration: pumps/zone valves/fertilizer valves including Denso valves (reads the copy persisted by the backend from the irr_out echo — independent of realtime)
- GET/api/v1/iot/devices/{deviceId}/output-config/mcv-cfg— Denso valve settings sync status: the value set (desired), what the board holds (reported, from the dev_cfg echo), ack, and one of 8 states
- GET/api/v1/iot/devices/{deviceId}/output-config/summary— Summary bundle of the output configuration the server has STORED (free_ports…) — returns raw JSON, independent of realtime (no more flakiness). 204 if the server has never received it.
- GET/api/v1/iot/devices/{deviceId}/schedules— List a device's timer schedules
- GET/api/v1/iot/devices/{deviceId}/setpoints— GET /api/v1/iot/devices/{deviceId}/setpoints
- GET/api/v1/iot/devices/{id}— Get an IoT device — full fields for the 4-tab detail page
- GET/api/v1/iot/emergency-stop— Active emergency stop locks (activeOnly=true, default) or the 20 most recent
- GET/api/v1/iot/reports/irrigation-logs— List irrigation history (paginated)
- GET/api/v1/iot/reports/irrigation-summary— Irrigation report summary
- GET/api/v1/iot/reports/irrigation-summary/export— Export the irrigation report to Excel
- GET/api/v1/iot/schedules/upcoming— Upcoming irrigation slots for the whole farm (grouped by slot)
- GET/api/v1/iot/search— Search devices
- GET/api/v1/iot/sensor-readings— Query sensor readings over a time range
- GET/api/v1/iot/sensor-readings/latest— Latest value of each device (last 30 minutes)
- GET/api/v1/iot/setup/progress— IoT device onboarding progress inferred from existing data
/api/v1/harvestHarvest records, pre-harvest intervals, traceability lots, QR labels, certificates, market prices.
- GET/api/v1/harvest/certifications— List the workspace's certificates
- GET/api/v1/harvest/certifications/expiring— Expiring certificates
- GET/api/v1/harvest/harvest-records— List harvest records
- POST/api/v1/harvest/harvest-records— Declare a harvest
- GET/api/v1/harvest/harvest-records/preview-trace— Pre-lock check: what the trace bundle will receive
- GET/api/v1/harvest/harvest-records/summary— Yield summary by household / zone / crop / parcel
- GET/api/v1/harvest/harvest-records/{id}— Get a harvest record
- PUT/api/v1/harvest/harvest-records/{id}— Update a harvest declaration
- GET/api/v1/harvest/market-prices— List recorded prices
- GET/api/v1/harvest/market-prices/series— Price series over time for charting
- GET/api/v1/harvest/market-prices/{id}— Get a price record
- GET/api/v1/harvest/parcels/phi-active— Parcels currently within a pre-harvest interval
- GET/api/v1/harvest/parcels/{parcelId}/phi-status— Whether a parcel is within a pre-harvest interval
- GET/api/v1/harvest/product-infos— List product profiles
- GET/api/v1/harvest/qr-codes— List QR codes of a season
- GET/api/v1/harvest/qr-codes/usage— Labels used / cap of the Free plan (5 labels total per workspace)
- GET/api/v1/harvest/qr-codes/{id}/scans— Daily scans of a QR code
- GET/api/v1/harvest/search— Search harvest records, QR labels, certificates
- GET/api/v1/harvest/trace— List the workspace's TraceBundles (sign-in required)
- GET/api/v1/harvest/trace-anchors— The workspace's anchoring runs with batches + sealed batches awaiting the next run
- GET/api/v1/harvest/trace-certificate/{id}— Blockchain verification certificate (PDF)
- GET/api/v1/harvest/trace-incidents— The workspace's data drift incidents
- GET/api/v1/harvest/trace-pdf/{code}— Download the traceability PDF by QR code (SIGN-IN REQUIRED)
- GET/api/v1/harvest/trace-seal-document/{id}— Download the sealed document (full hashed version) — internal users only
- GET/api/v1/harvest/trace-settings— GET /api/v1/harvest/trace-settings
/api/v1/officeThe farm's custom books (logs, inventory, costs…), calendar and automation rules: read tables, read/add/edit rows.
- GET/api/v1/office/apps— List apps (paginated)
- GET/api/v1/office/apps/{appId}/dashboards— List dashboards of an app
- GET/api/v1/office/apps/{appId}/tables— List tables of an app
- GET/api/v1/office/apps/{appId}/tables/{tableId}— Get a table
- GET/api/v1/office/apps/{id}— Get an app
- GET/api/v1/office/automation-logs— Run log, newest first
- GET/api/v1/office/automation-logs/metrics— Operational metrics for Automation in the company
- GET/api/v1/office/automation-logs/runs— History by RUN, newest first
- GET/api/v1/office/automation-logs/stats— The four stat tiles at the top of the log screen
- GET/api/v1/office/automation-templates— List the company's templates, newest first
- GET/api/v1/office/automations— Danh sách automation
- GET/api/v1/office/automations/ai-columns/catalog— Catalog of AI column modes
- GET/api/v1/office/automations/catalog— Catalog of triggers/actions available for building automations
- GET/api/v1/office/automations/merge-fields— Catalog of {{…}} variables insertable into action configuration
- GET/api/v1/office/automations/quota— The company's monthly run quota
- GET/api/v1/office/automations/service-events— Catalog of events from other software (service_event trigger)
- GET/api/v1/office/automations/suggestions— Automation suggestions tailored to the company (Suggestions tab)
- GET/api/v1/office/automations/summary— Counts for the Automation Center
- GET/api/v1/office/automations/{id}— Get an automation (with steps)
- GET/api/v1/office/automations/{id}/diagnosis— Diagnostics: why a rule runs / does not run
- GET/api/v1/office/automations/{id}/overlaps— Other rules with the same trigger doing the same thing
- GET/api/v1/office/automations/{id}/webhook/sample— Data sample + key tree
- GET/api/v1/office/calendar-links— My calendar connection status
- GET/api/v1/office/calendar-links/meeting-providers— Enabled online meeting providers
- GET/api/v1/office/calendar-preferences— My calendar screen settings
- GET/api/v1/office/calendars— Calendars I am subscribed to (left column)
- GET/api/v1/office/calendars/subscribable— Calendars available to subscribe to
- GET/api/v1/office/connection-keys— List issued keys
- GET/api/v1/office/dashboards/{id}/widgets/{widgetId}/data— Figures for one tile, computed per the viewer's permissions
- GET/api/v1/office/events— Events within a time range
- GET/api/v1/office/events/{id}— Get an event with its attendees and booked rooms
- GET/api/v1/office/events/{id}.ics— Download the event's .ics calendar file
- GET/api/v1/office/farm/device-controls— List command tickets
- GET/api/v1/office/farm/device-controls/emergency-stop— EMERGENCY STOP status of the farm's automatic device control
- GET/api/v1/office/farm/device-controls/rules/{automationId}/approval— Auto-run approval status of a rule
- GET/api/v1/office/meeting-minutes— Minutes of a meeting
- GET/api/v1/office/meeting-rooms— List meeting rooms
- GET/api/v1/office/meeting-rooms/{id}/busy-slots— Busy time slots of a room
- GET/api/v1/office/tables/{tableId}/fields— List fields of a table
- GET/api/v1/office/tables/{tableId}/fields/{fieldId}— Get a field
- POST/api/v1/office/tables/{tableId}/records— Create a record
- POST/api/v1/office/tables/{tableId}/records/aggregate— Aggregate by column (sum · average · min · max · count)
- POST/api/v1/office/tables/{tableId}/records/batch— Create multiple records (up to 1000, all-or-nothing)
- PUT/api/v1/office/tables/{tableId}/records/batch— Update multiple records (up to 1000, all-or-nothing)
- POST/api/v1/office/tables/{tableId}/records/groups— Row groups: group column value + row count, in the same order as records/list
- POST/api/v1/office/tables/{tableId}/records/list— List records (paginated + structured filter in the body)
- GET/api/v1/office/tables/{tableId}/records/{recordId}— Get a record
- PUT/api/v1/office/tables/{tableId}/records/{recordId}— Update a record (merge by default; replace=true to overwrite)
- GET/api/v1/office/tables/{tableId}/records/{recordId}/history— Edit history of a record, split by cell (filtered by column permissions)
- GET/api/v1/office/tables/{tableId}/trash— Trash — soft-deleted records of a table (paginated)
- GET/api/v1/office/tables/{tableId}/views— List views of a table
- GET/api/v1/office/tables/{tableId}/views/{viewId}— Get a view
- GET/api/v1/office/tables/{tableId}/views/{viewId}/calendar-data— Records within the date range of a Calendar view
- GET/api/v1/office/tables/{tableId}/views/{viewId}/chart-data— Aggregated data for a Chart view
- GET/api/v1/office/tasks/monitor— Monitoring screen: six stat tiles + team-wide table + each person's tasks
- GET/api/v1/office/tasks/workload— Workload per person
- GET/api/v1/office/views/{viewId}/location— Trace back from a view ID to the table and app that contain it
/api/v1/reportsReports and labour cost by period.
- GET/api/v1/reports/catalog— Report catalog with the number of blocks the viewer can see
- GET/api/v1/reports/exports/{id}— Status of an export: pending · running · completed · failed
- GET/api/v1/reports/exports/{id}/file— Download the exported file (404 after 24 hours)
- GET/api/v1/reports/labor-cost— Labour cost by parcel / season
- GET/api/v1/reports/query— Run a report via GET; missing to = today (UTC+7), missing from = to - 29 days
- GET/api/v1/reports/trace— Multi-level traceability from a node (harvest record, piece-rate sheet, document, payslip, sales slip…)