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.
AgroPulse can notify people by email and WhatsApp when alerts are triggered in a greenhouse. Recipients are scoped to a single greenhouse — each greenhouse maintains its own list, so you can configure different contacts for different sites. A recipient can receive email notifications, WhatsApp messages via CallMeBot, or both, depending on which fields you provide.
Start by adding a single recipient (yourself) and trigger a test alert before rolling out notifications to your full team. This confirms your email address and CallMeBot API key are working before you add everyone else.
Adding recipients
Email recipient
WhatsApp recipient
Post to /api/greenhouses/{id}/alert-recipients with a name and email. The active field defaults to true so the recipient receives notifications immediately.curl -s -X POST http://localhost:8080/api/greenhouses/1/alert-recipients \
-H "Content-Type: application/json" \
-d '{
"name": "María García",
"email": "maria.garcia@example.com"
}'
{
"id": 4,
"greenhouseId": 1,
"name": "María García",
"email": "maria.garcia@example.com",
"phone": null,
"callmebotApikey": null,
"active": true
}
To send WhatsApp notifications, include both phone (in international format, e.g. +34612345678) and callmebotApikey. AgroPulse uses the CallMeBot gateway to deliver messages to the recipient’s WhatsApp account.curl -s -X POST http://localhost:8080/api/greenhouses/1/alert-recipients \
-H "Content-Type: application/json" \
-d '{
"name": "Carlos López",
"phone": "+34612345678",
"callmebotApikey": "123456"
}'
{
"id": 5,
"greenhouseId": 1,
"name": "Carlos López",
"email": null,
"phone": "+34612345678",
"callmebotApikey": "123456",
"active": true
}
Each WhatsApp recipient must obtain their own CallMeBot API key by sending a WhatsApp message to the CallMeBot number at api.callmebot.com. AgroPulse does not generate or manage these keys — you must collect them from each user individually and store them here. You can also provide both email and phone/callmebotApikey on the same recipient to receive notifications through both channels.
Listing recipients for a greenhouse
curl "http://localhost:8080/api/greenhouses/1/alert-recipients"
{
"recipients": [
{
"id": 4,
"greenhouseId": 1,
"name": "María García",
"email": "maria.garcia@example.com",
"phone": null,
"callmebotApikey": null,
"active": true
},
{
"id": 5,
"greenhouseId": 1,
"name": "Carlos López",
"email": null,
"phone": "+34612345678",
"callmebotApikey": "123456",
"active": true
}
]
}
Removing a recipient
Delete a recipient by ID. You must also supply the greenhouse ID in the path — the API verifies that the recipient belongs to that greenhouse before deleting.
curl -s -X DELETE http://localhost:8080/api/greenhouses/1/alert-recipients/5
Response: {"deleted": true}
If the recipientId does not belong to the specified greenhouse, the API returns 404 Not Found.
Access control
Only the greenhouse owner or an ADMIN user can add or remove alert recipients. Requests from other users will receive a 403 Forbidden response.