curl -X DELETE 'https://www.wiseyield.co/api/v1/crops/33333333-4444-5555-6666-777777777777' \
-H "Authorization: Bearer $WISEYIELD_API_KEY"
const res = await fetch(
`https://www.wiseyield.co/api/v1/crops/${cropId}`,
{
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.WISEYIELD_API_KEY}` },
}
);
// res.status === 204; no body
import os, requests
res = requests.delete(
f'https://www.wiseyield.co/api/v1/crops/{crop_id}',
headers={'Authorization': f"Bearer {os.environ['WISEYIELD_API_KEY']}"},
)
assert res.status_code == 204
(no body)
{
"error": "Not found",
"code": "NOT_FOUND",
"message": "Crop not found"
}
Crops
Delete crop
Soft-delete a crop. Records remain in the database for audit and FK integrity.
DELETE
/
api
/
v1
/
crops
/
{id}
curl -X DELETE 'https://www.wiseyield.co/api/v1/crops/33333333-4444-5555-6666-777777777777' \
-H "Authorization: Bearer $WISEYIELD_API_KEY"
const res = await fetch(
`https://www.wiseyield.co/api/v1/crops/${cropId}`,
{
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.WISEYIELD_API_KEY}` },
}
);
// res.status === 204; no body
import os, requests
res = requests.delete(
f'https://www.wiseyield.co/api/v1/crops/{crop_id}',
headers={'Authorization': f"Bearer {os.environ['WISEYIELD_API_KEY']}"},
)
assert res.status_code == 204
(no body)
{
"error": "Not found",
"code": "NOT_FOUND",
"message": "Crop not found"
}
DELETE https://www.wiseyield.co/api/v1/crops/{id}
Authentication
Requires a key with thecrops:write scope.
Path parameters
string
required
Crop UUID.
Response
Returns204 No Content on success. The crop’s deletedAt is set to the current timestamp; subsequent reads return 404 NOT_FOUND. See Soft deletes for the full semantics.
curl -X DELETE 'https://www.wiseyield.co/api/v1/crops/33333333-4444-5555-6666-777777777777' \
-H "Authorization: Bearer $WISEYIELD_API_KEY"
const res = await fetch(
`https://www.wiseyield.co/api/v1/crops/${cropId}`,
{
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.WISEYIELD_API_KEY}` },
}
);
// res.status === 204; no body
import os, requests
res = requests.delete(
f'https://www.wiseyield.co/api/v1/crops/{crop_id}',
headers={'Authorization': f"Bearer {os.environ['WISEYIELD_API_KEY']}"},
)
assert res.status_code == 204
(no body)
{
"error": "Not found",
"code": "NOT_FOUND",
"message": "Crop not found"
}
Errors
| Status | When |
|---|---|
400 INVALID_ID | {id} is not a valid UUID |
401 | Missing, malformed, expired, or revoked API key |
403 INSUFFICIENT_SCOPE | Key lacks crops:write scope |
404 NOT_FOUND | Crop doesn’t exist, is already soft-deleted, or belongs to a farm the user doesn’t own |
429 RATE_LIMIT_EXCEEDED | Per-user rate limit reached |
5xx | Server error |