Crop is the catalog of crop types that a Cultivation references — for example, "Wheat" or "Corn". Unlike every other resource in Farm Management, it is not scoped to your company.
This page covers only what's specific to Crops. For the base URL, authentication, the response envelope, and the foreign-key _id convention, see Farm Management Overview.
Crop is a global, shared catalog, not scoped to your company — it has no
companyorcreated_byfields at all. List results are always sorted with "Wheat" first, then the rest. Any create, edit, or delete you perform here changes the shared catalog for every company on the platform, not just yours — use this endpoint carefully.
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /crop/ | List crops |
| POST | /crop/ | Create a crop (single object only — no bulk) |
| GET | /crop/CROP_ID/ | Retrieve a single crop |
| PUT | /crop/CROP_ID/ | Replace a crop |
| PATCH | /crop/CROP_ID/ | Partially update a crop |
| DELETE | /crop/CROP_ID/ | Delete a crop |
Auth
Requires a Bearer token — see Farm Management Overview for how to send one.
Each action also requires a dynamic permission on top of the token:
| Action | Required permission |
|---|---|
| List / Retrieve | crop.view |
| Create | crop.create |
| Update / Partial update | crop.edit |
| Delete | crop.delete |
A request with a valid token but missing the required permission gets an HTTP 403 with the structured body described in Farm Management Overview.
Create / update fields
| Field | Type | Required |
|---|---|---|
name | string, max 255 | Yes |
name_de | string, max 255 (German name) | Yes |
No bulk create
Crops do not support bulk create.
POST /crop/only accepts a single object — send a JSON array and it will not be treated as a batch of crops the way it would be on Farms, Fields, Seasons, Cultivations, or Fertilization.
Status codes
| Status | Trigger |
|---|---|
| 200 | List, retrieve, create, or update succeeded. |
| 204 | Delete succeeded. |
| 400 | Validation failure (for example, missing name or name_de). |
| 403 | Missing crop.view / crop.create / crop.edit / crop.delete permission. |
| 404 | Crop not found. |
Create request
curl -X POST https://backend.spacenus.de/api/v1.2/crop/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Corn",
"name_de": "Mais"
}'Response:
{
"status": "success",
"message": "Crop created successfully.",
"data": {
"id": 12,
"name": "Corn",
"name_de": "Mais"
}
}