curl -X POST https://www.wiseyield.co/api/v1/crops \
-H "Authorization: Bearer $WISEYIELD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"farmId": "11111111-2222-3333-4444-555555555555",
"fieldId": "88888888-9999-aaaa-bbbb-cccccccccccc",
"cropType": "date palm",
"variety": "Medjool",
"plantedArea": 4.2,
"plantingDate": "2024-03-15",
"season": "spring",
"seasonYear": 2024,
"status": "growing"
}'
const res = await fetch('https://www.wiseyield.co/api/v1/crops', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WISEYIELD_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
farmId: '11111111-2222-3333-4444-555555555555',
fieldId: '88888888-9999-aaaa-bbbb-cccccccccccc',
cropType: 'date palm',
variety: 'Medjool',
plantedArea: 4.2,
status: 'growing',
}),
});
const { data: crop } = await res.json();
import os, requests
res = requests.post(
'https://www.wiseyield.co/api/v1/crops',
headers={
'Authorization': f"Bearer {os.environ['WISEYIELD_API_KEY']}",
'Content-Type': 'application/json',
},
json={
'farmId': '11111111-2222-3333-4444-555555555555',
'fieldId': '88888888-9999-aaaa-bbbb-cccccccccccc',
'cropType': 'date palm',
'variety': 'Medjool',
'plantedArea': 4.2,
'status': 'growing',
},
)
crop = res.json()['data']
{
"data": {
"id": "33333333-4444-5555-6666-777777777777",
"farmId": "11111111-2222-3333-4444-555555555555",
"fieldId": "88888888-9999-aaaa-bbbb-cccccccccccc",
"cropType": "date palm",
"variety": "Medjool",
"plantedArea": "4.2",
"plantingDate": "2024-03-15T00:00:00.000Z",
"season": "spring",
"seasonYear": 2024,
"status": "growing",
"createdAt": "2026-05-17T16:00:00.000Z",
"updatedAt": "2026-05-17T16:00:00.000Z"
}
}
{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"plantedArea": ["Planted area must be a positive number"],
"fieldId": ["Valid field ID required"]
}
}
{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"message": "Field not found on this farm"
}
{
"error": "Not found",
"code": "NOT_FOUND",
"message": "Farm not found or access denied"
}
Crops
Create crop
Create a crop on a farm and field owned by the authenticated user.
POST
/
api
/
v1
/
crops
curl -X POST https://www.wiseyield.co/api/v1/crops \
-H "Authorization: Bearer $WISEYIELD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"farmId": "11111111-2222-3333-4444-555555555555",
"fieldId": "88888888-9999-aaaa-bbbb-cccccccccccc",
"cropType": "date palm",
"variety": "Medjool",
"plantedArea": 4.2,
"plantingDate": "2024-03-15",
"season": "spring",
"seasonYear": 2024,
"status": "growing"
}'
const res = await fetch('https://www.wiseyield.co/api/v1/crops', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WISEYIELD_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
farmId: '11111111-2222-3333-4444-555555555555',
fieldId: '88888888-9999-aaaa-bbbb-cccccccccccc',
cropType: 'date palm',
variety: 'Medjool',
plantedArea: 4.2,
status: 'growing',
}),
});
const { data: crop } = await res.json();
import os, requests
res = requests.post(
'https://www.wiseyield.co/api/v1/crops',
headers={
'Authorization': f"Bearer {os.environ['WISEYIELD_API_KEY']}",
'Content-Type': 'application/json',
},
json={
'farmId': '11111111-2222-3333-4444-555555555555',
'fieldId': '88888888-9999-aaaa-bbbb-cccccccccccc',
'cropType': 'date palm',
'variety': 'Medjool',
'plantedArea': 4.2,
'status': 'growing',
},
)
crop = res.json()['data']
{
"data": {
"id": "33333333-4444-5555-6666-777777777777",
"farmId": "11111111-2222-3333-4444-555555555555",
"fieldId": "88888888-9999-aaaa-bbbb-cccccccccccc",
"cropType": "date palm",
"variety": "Medjool",
"plantedArea": "4.2",
"plantingDate": "2024-03-15T00:00:00.000Z",
"season": "spring",
"seasonYear": 2024,
"status": "growing",
"createdAt": "2026-05-17T16:00:00.000Z",
"updatedAt": "2026-05-17T16:00:00.000Z"
}
}
{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"plantedArea": ["Planted area must be a positive number"],
"fieldId": ["Valid field ID required"]
}
}
{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"message": "Field not found on this farm"
}
{
"error": "Not found",
"code": "NOT_FOUND",
"message": "Farm not found or access denied"
}
POST https://www.wiseyield.co/api/v1/crops
Authentication
Requires a key with thecrops:write scope. See Authentication.
Request body
string
required
UUID of the parent farm. Must be owned by the authenticated user.
string
required
UUID of the field. Must belong to
farmId. Required per the Operations Attachment Principle.string
required
1–200 characters. Free-text crop name (e.g.
"wheat", "date palm").number | string
required
Positive number in the farm’s
areaUnit. Accepts string or number.string
Up to 200 characters. Free-text variety.
string
UUID linking to the admin Crop Library. Prefer this over
cropType when the crop is in the catalog.string
UUID linking to the admin variety record.
string
Calendar date as
YYYY-MM-DD. A full ISO 8601 datetime is accepted too, but only its date part is kept.string
Calendar date as
YYYY-MM-DD. A full ISO 8601 datetime is accepted too, but only its date part is kept.string
One of
winter, summer, autumn, spring, year_round.integer
2000–2100.
number | string
Tons.
number | string
In the farm’s
currency.number | string
In the farm’s
currency.string
default:"planned"
One of
planned, planted, growing, harvested, failed.string
Up to 5,000 characters.
Response
Returns the created crop wrapped underdata. See List crops for the full field reference.
curl -X POST https://www.wiseyield.co/api/v1/crops \
-H "Authorization: Bearer $WISEYIELD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"farmId": "11111111-2222-3333-4444-555555555555",
"fieldId": "88888888-9999-aaaa-bbbb-cccccccccccc",
"cropType": "date palm",
"variety": "Medjool",
"plantedArea": 4.2,
"plantingDate": "2024-03-15",
"season": "spring",
"seasonYear": 2024,
"status": "growing"
}'
const res = await fetch('https://www.wiseyield.co/api/v1/crops', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WISEYIELD_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
farmId: '11111111-2222-3333-4444-555555555555',
fieldId: '88888888-9999-aaaa-bbbb-cccccccccccc',
cropType: 'date palm',
variety: 'Medjool',
plantedArea: 4.2,
status: 'growing',
}),
});
const { data: crop } = await res.json();
import os, requests
res = requests.post(
'https://www.wiseyield.co/api/v1/crops',
headers={
'Authorization': f"Bearer {os.environ['WISEYIELD_API_KEY']}",
'Content-Type': 'application/json',
},
json={
'farmId': '11111111-2222-3333-4444-555555555555',
'fieldId': '88888888-9999-aaaa-bbbb-cccccccccccc',
'cropType': 'date palm',
'variety': 'Medjool',
'plantedArea': 4.2,
'status': 'growing',
},
)
crop = res.json()['data']
{
"data": {
"id": "33333333-4444-5555-6666-777777777777",
"farmId": "11111111-2222-3333-4444-555555555555",
"fieldId": "88888888-9999-aaaa-bbbb-cccccccccccc",
"cropType": "date palm",
"variety": "Medjool",
"plantedArea": "4.2",
"plantingDate": "2024-03-15T00:00:00.000Z",
"season": "spring",
"seasonYear": 2024,
"status": "growing",
"createdAt": "2026-05-17T16:00:00.000Z",
"updatedAt": "2026-05-17T16:00:00.000Z"
}
}
{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"plantedArea": ["Planted area must be a positive number"],
"fieldId": ["Valid field ID required"]
}
}
{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"message": "Field not found on this farm"
}
{
"error": "Not found",
"code": "NOT_FOUND",
"message": "Farm not found or access denied"
}
Errors
| Status | When |
|---|---|
400 VALIDATION_ERROR | Schema validation failed (details carries per-field messages), OR fieldId doesn’t belong to farmId |
401 | Missing, malformed, expired, or revoked API key |
403 INSUFFICIENT_SCOPE | Key lacks crops:write scope |
404 NOT_FOUND | farmId not owned by the authenticated user (or soft-deleted) |
429 RATE_LIMIT_EXCEEDED | Per-user rate limit reached |
5xx | Server error |