The Greenhouses API is the central resource in AgroPulse. Each greenhouse represents a physical growing environment monitored by IoT sensors. You can create and manage greenhouse records, update their metadata (name, location, GPS coordinates, photo), and control which users are assigned to each greenhouse. Write operations on a greenhouse require that the caller is either the greenhouse owner or an administrator — identified via request headers.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/diarpicu2022-commits/backend-AgroPulse/llms.txt
Use this file to discover all available pages before exploring further.
Ownership restriction:
PUT /api/greenhouses/{id} and DELETE /api/greenhouses/{id} check the X-User-Id request header against the greenhouse’s ownerId. Users who are neither the owner nor an admin (identified by the X-Admin-Email header matching the AGROPULSE_ADMIN_EMAIL environment variable) receive a 403 Forbidden response.GET /api/greenhouses — List all greenhouses
GET /api/greenhouses — List all greenhouses
POST /api/greenhouses — Create a greenhouse
POST /api/greenhouses — Create a greenhouse
Creates a new greenhouse record.Request bodyResponse — the created greenhouse object (same shape as the list item above).
Display name of the greenhouse. Maximum 100 characters.
Human-readable location (e.g. city, zone, or address).
Free-text description of the greenhouse and its purpose.
ID of the user who will own this greenhouse.
Whether the greenhouse is active. Defaults to
true when omitted.GPS latitude coordinate.
GPS longitude coordinate.
URL pointing to a photo of the greenhouse. Maximum 500 characters.
GET /api/greenhouses/{id} — Get greenhouse by ID
GET /api/greenhouses/{id} — Get greenhouse by ID
Returns a single greenhouse by its numeric ID.Path parametersReturns
The greenhouse ID.
404 Not Found when no greenhouse with that ID exists.PUT /api/greenhouses/{id} — Update a greenhouse
PUT /api/greenhouses/{id} — Update a greenhouse
Updates one or more fields of an existing greenhouse. Only the fields present in the request body are changed; omitted fields are left as-is.Path parametersRequest body (all fields optional)Response — the updated greenhouse object.
The greenhouse ID to update.
Updated name.
Updated location string.
Updated description.
Transfer ownership to another user ID.
Set active status.
Updated GPS latitude.
Updated GPS longitude.
Updated photo URL.
DELETE /api/greenhouses/{id} — Delete a greenhouse
DELETE /api/greenhouses/{id} — Delete a greenhouse
Permanently deletes a greenhouse record.Path parametersReturns
The greenhouse ID to delete.
404 Not Found if the greenhouse does not exist.GET /api/greenhouses/{id}/users — List assigned users
GET /api/greenhouses/{id}/users — List assigned users
POST /api/greenhouses/{id}/users — Assign a user
POST /api/greenhouses/{id}/users — Assign a user