The Farms API is the foundation of the Surqo platform. Every farm (finca) you register becomes the anchor for sensor readings, AI analyses, and real-time agronomic KPIs. Each farm stores the GPS coordinates and crop type that allow the system to pull accurate weather forecasts and apply crop-specific thresholds. Free-plan accounts are limited to one active farm — instead of creating a second farm you can edit the existing one to change the crop type or location.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ricardomb-tech/surqo/llms.txt
Use this file to discover all available pages before exploring further.
Create a farm
If
owner_email or owner_name are omitted, the API automatically fills them from the authenticated user’s profile.POST /api/v1/farms/ — Rate limit: 10 requests / minute
Request body
Human-readable farm name. Maximum 200 characters.
Primary crop grown on the farm. Accepted values:
maíz, yuca, plátano, café, arroz, algodón.Farm latitude in decimal degrees. Must be between
-90 and 90.Farm longitude in decimal degrees. Must be between
-180 and 180.Full name of the farm owner. Falls back to the authenticated user’s
full_name when omitted.Contact email for the farm owner. Falls back to the authenticated user’s email when omitted.
Farm surface area in hectares. Must be greater than
0.Altitude above sea level in metres.
Colombian department where the farm is located. Defaults to
"Córdoba".Municipality within the department.
Response 201
Returns a FarmResponse object.
Unique farm identifier. Use this UUID in all subsequent farm-scoped requests.
Farm name as stored.
Crop type as stored.
GPS latitude.
GPS longitude.
Farm area in hectares.
Altitude in metres above sea level.
Resolved owner name.
Resolved owner contact email.
Colombian department.
Municipality.
Whether the farm is currently active. Defaults to
true on creation.ISO 8601 timestamp of when the farm was created.
Example
Response 201
Error: farm limit reached
When a free-plan user already has one farm, the API responds with:Response 400
List farms
GET /api/v1/farms/ — Auth required
Returns all farms belonging to the authenticated user.
Query parameters
When
true (default), only farms with is_active = true are returned. Set to false to include deactivated farms.Response 200
Returns an array of FarmResponse objects. See the Create a farm section for the full field reference.
Get a farm
GET /api/v1/farms/{farm_id} — Auth required
Returns a single farm by its UUID.
The UUID of the farm to retrieve.
403 if the farm belongs to a different user, and 404 if the farm does not exist.
Update a farm
PATCH /api/v1/farms/{farm_id} — Auth required
Partially updates a farm. Only the fields you include in the request body are modified; all other fields remain unchanged.
The UUID of the farm to update.
Request body (all fields optional)
New farm name (max 200 characters).
Updated crop type. Accepted values:
maíz, yuca, plátano, café, arroz, algodón.Updated owner name.
Updated owner contact email.
Updated farm area in hectares (must be
> 0).Updated altitude above sea level.
Updated department.
Updated municipality.
Set to
false to deactivate the farm without deleting it.403 if the farm belongs to a different user, and 404 if the farm does not exist.
Delete a farm
DELETE /api/v1/farms/{farm_id} — Auth required
Permanently removes a farm and all data directly tied to it.
The UUID of the farm to delete.
204 No Content on success. Returns 403 if the farm belongs to a different user, and 404 if the farm does not exist.
Get farm KPIs
GET /api/v1/farms/{farm_id}/kpis — Auth required
Returns a snapshot of agronomic key performance indicators computed from the farm’s sensor readings over the last 24 hours. This endpoint is designed for dashboard widgets and status cards.
The UUID of the farm.
Response 200
Vapour Pressure Deficit in kilopascals, calculated via the Magnus equation from air temperature and humidity readings.
Average air temperature (°C) over the last 24 hours.
Average relative air humidity (%) over the last 24 hours.
Average soil moisture (%) over the last 24 hours.
Composite soil health score from 0 to 100.
Number of sensor readings received in the last 24 hours.
Timestamp of the most recent sensor reading.
Response 200