The Notifications API exposes user-scoped in-app notifications. All routes require a valid Bearer token. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSebasSV/healtyhelp/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/notifications/mensaje route additionally requires an admin role.
The Notification object
Field reference
| Field | Type | Description |
|---|---|---|
_id | string | MongoDB ObjectId of the notification |
userId | string | ObjectId of the notification recipient |
type | string | Notification type: reply, message, or new_recipe |
leida | boolean | false until the user marks it as read |
fromUserId | string | null | ObjectId of the user who triggered a reply notification; null otherwise |
fromUserName | string | Display name of the user who replied (denormalised for resilience) |
recetaId | string | null | ObjectId of the related recipe (reply and new_recipe types) |
recetaNombre | string | Recipe name at notification time |
resenaId | string | null | ObjectId of the review being replied to |
respuestaId | string | null | ObjectId of the specific reply — use for deep-linking |
respuestaTexto | string | Truncated preview of the reply text (max 120 chars) |
adminId | string | null | ObjectId of the admin who sent a message type notification |
adminName | string | Admin display name (denormalised; remains visible even if the account is deleted) |
asunto | string | Subject line for message notifications (max 120 chars) |
mensaje | string | Body text for message notifications (max 1,000 chars) |
recetaCat | string | Recipe category slug for new_recipe notifications |
recetaSalud | string[] | Health tags of the recipe for new_recipe notifications |
createdAt | string | ISO 8601 UTC timestamp of creation |
updatedAt | string | ISO 8601 UTC timestamp of last update |
Notification types
type | Triggered when |
|---|---|
reply | Another user replies to a review written by the authenticated user |
message | An admin sends a direct message via POST /api/notifications/mensaje |
new_recipe | A new recipe is published — broadcast to all users |
Endpoints
GET /api/notifications
Returns the 30 most recent notifications for the authenticated user, sorted newest-first. Response200 OK
| Field | Type | Description |
|---|---|---|
success | boolean | Always true on success |
notificaciones | array | Up to 30 Notification objects, sorted by createdAt descending |
noLeidas | number | Count of unread notifications in the returned set |
GET /api/notifications/no-leidas
Returns only the count of unread notifications. Intended for the navbar badge; avoids fetching full notification payloads. Response200 OK
PUT /api/notifications/leer-todas
Marks all of the authenticated user’s unread notifications as read in a single operation. Response200 OK
PUT /api/notifications/:id/leer
Marks a single notification as read. The notification must belong to the authenticated user. Path parameterMongoDB ObjectId of the notification to mark as read.
200 OK
| Status | Condition |
|---|---|
404 | Notification not found or does not belong to the authenticated user |
DELETE /api/notifications/:id
Permanently deletes a notification owned by the authenticated user. Path parameterMongoDB ObjectId of the notification to delete.
200 OK
| Status | Condition |
|---|---|
404 | Notification not found or does not belong to the authenticated user |
POST /api/notifications/mensaje
Sends a directmessage-type notification to a specific user. The notification appears in the recipient’s inbox immediately.
Request body
MongoDB ObjectId of the recipient user. The user must exist in the database.
Notification body text. Must be non-empty and at most 1,000 characters.
Optional subject line. Truncated to 120 characters. Defaults to an empty string if omitted.
201 Created
| Status | Condition |
|---|---|
400 | userId is missing, mensaje is empty, or mensaje exceeds 1,000 characters |
403 | Authenticated user does not have the admin role |
404 | Recipient user not found |