Every monitored site in AgroPulse is represented as a greenhouse. A greenhouse acts as the top-level container for sensors, actuators, automation rules, and alert recipients. Once a greenhouse exists, sensors can be attached to it and users can be granted access to view or manage it.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.
Only the greenhouse owner (
ownerId) or a user with the ADMIN role can update or delete a greenhouse, or modify its user membership. Regular users who have been assigned access can read data but cannot change greenhouse settings.Greenhouse fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Human-readable greenhouse name |
location | string | no | Physical address or site description |
description | string | no | Free-text notes about the greenhouse |
ownerId | integer | no | User ID of the greenhouse owner |
active | boolean | no | Whether the greenhouse is currently operational (default true) |
latitude | number | no | GPS latitude for map display |
longitude | number | no | GPS longitude for map display |
photoUrl | string | no | URL to a representative photo |
Full setup workflow
Create the greenhouse
Send a The response returns the created greenhouse object including its assigned
POST to /api/greenhouses with at minimum a name. Include ownerId to assign ownership immediately.id (e.g. 3). Use this ID in all subsequent requests.Register sensors
Add sensors to the greenhouse by posting to List all sensors for the greenhouse at any time:
/api/sensors. Each sensor must reference the greenhouseId returned in the previous step.Assign users
Grant a user access to the greenhouse by posting their A successful response returns
userId to the greenhouse’s users sub-resource.{"assigned": true}. The user is now listed when you GET /api/greenhouses/3/users.Updating a greenhouse
Send aPUT to /api/greenhouses/{id} with only the fields you want to change. Fields not included in the request body are left unchanged.
Removing user access
{"removed": true}