Skip to main content
GET
/
api
/
v1
/
farms
curl 'https://www.wiseyield.co/api/v1/farms?page=1&limit=20&status=active&sort=name&order=asc' \
  -H "Authorization: Bearer $WISEYIELD_API_KEY"
{
  "data": [
    {
      "id": "11111111-2222-3333-4444-555555555555",
      "name": "Green Valley Farm",
      "farmType": "commercial",
      "primaryUse": "crops",
      "city": "Cairo",
      "country": "Egypt",
      "totalArea": "250",
      "areaUnit": "hectare",
      "soilType": "sandy loam",
      "irrigationSystem": "drip",
      "status": "active",
      "createdAt": "2026-04-12T10:00:00.000Z",
      "updatedAt": "2026-05-14T14:30:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 1,
    "totalPages": 1
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.wiseyield.co/llms.txt

Use this file to discover all available pages before exploring further.

The versioned /api/v1/farms endpoint is the API-key-authenticated path for managing farms. The list operation returns paginated farms owned by the authenticated user; the create operation persists a new farm under that user.

List farms

GET https://www.wiseyield.co/api/v1/farms

Authentication

Requires a key with the farms:read scope. See Authentication.

Query parameters

page
integer
default:"1"
Page number (≥ 1).
limit
integer
default:"20"
Results per page (1–100; values above 100 are clamped to 100).
status
string
Filter by farm status: active, inactive, archived, draft.
sort
string
default:"createdAt"
Sort field: createdAt, name, totalArea.
order
string
default:"desc"
Sort direction: asc, desc.

Response

Returns paginated farm records.
data
array
Array of farm objects.
pagination
object
curl 'https://www.wiseyield.co/api/v1/farms?page=1&limit=20&status=active&sort=name&order=asc' \
  -H "Authorization: Bearer $WISEYIELD_API_KEY"
{
  "data": [
    {
      "id": "11111111-2222-3333-4444-555555555555",
      "name": "Green Valley Farm",
      "farmType": "commercial",
      "primaryUse": "crops",
      "city": "Cairo",
      "country": "Egypt",
      "totalArea": "250",
      "areaUnit": "hectare",
      "soilType": "sandy loam",
      "irrigationSystem": "drip",
      "status": "active",
      "createdAt": "2026-04-12T10:00:00.000Z",
      "updatedAt": "2026-05-14T14:30:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 1,
    "totalPages": 1
  }
}

Create farm

POST https://www.wiseyield.co/api/v1/farms

Authentication

Requires a key with the farms:write scope.

Request body

name
string
required
1–200 characters.
city
string
required
1–200 characters.
country
string
required
1–200 characters.
totalArea
number
required
Positive number.
areaUnit
string
default:"hectare"
One of hectare, acre, feddan.
farmType
string
One of commercial, organic, mixed, specialty.
primaryUse
string
One of crops, livestock, mixed, research.
soilType
string
Up to 200 characters.
irrigationSystem
string
One of drip, sprinkler, flood, pivot, manual, none.
latitude
number
Between −90 and 90.
longitude
number
Between −180 and 180.
boundaries
object
GeoJSON Polygon ({ type: "Polygon", coordinates: number[][][] }).
status
string
default:"active"
One of active, inactive, archived, draft.

Response

Returns the created farm wrapped under data.
curl -X POST https://www.wiseyield.co/api/v1/farms \
  -H "Authorization: Bearer $WISEYIELD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Maple Ridge Farm",
    "city": "Portland",
    "country": "United States",
    "totalArea": 180,
    "areaUnit": "acre",
    "farmType": "organic",
    "primaryUse": "crops",
    "soilType": "loam",
    "irrigationSystem": "drip",
    "latitude": 45.5152,
    "longitude": -122.6784,
    "status": "active"
  }'
{
  "data": {
    "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
    "ownerId": "user_...",
    "name": "Maple Ridge Farm",
    "farmType": "organic",
    "primaryUse": "crops",
    "city": "Portland",
    "country": "United States",
    "totalArea": "180",
    "areaUnit": "acre",
    "soilType": "loam",
    "irrigationSystem": "drip",
    "latitude": "45.5152",
    "longitude": "-122.6784",
    "status": "active",
    "createdAt": "2026-05-17T14:23:01.000Z",
    "updatedAt": "2026-05-17T14:23:01.000Z"
  }
}

Errors

StatusWhen
400Validation failed — details carries per-field messages
401Missing, malformed, expired, or revoked API key
403Key lacks farms:read (GET) or farms:write (POST)
409Farm name already exists for this user (active rows only)
429Rate limit reached — see Rate-limit handling
5xxServer error — retry with backoff

Authentication

Scopes, key format, rate limits

Pagination

Iterator patterns for list endpoints

Errors

Canonical error response shape

API Keys

Manage keys from your dashboard