Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/160906/Yakultt-App/llms.txt

Use this file to discover all available pages before exploring further.

The Notifications API provides the in-app inbox for delivery drivers (Repartidor role). Notifications are created automatically by the Orders API — when a new order is assigned to a driver, or when an order’s status changes from outside the driver’s own actions. All endpoints identify the requesting user via the x-user-id request header rather than a Bearer token; omitting this header returns an empty result set rather than an error.

GET /api/notificaciones

Returns up to 50 notifications for the specified user, ordered from most recent to oldest.
Pass the user’s numeric ID in the x-user-id header. If the header is absent, the response will be an empty array.
Headers
HeaderTypeRequiredDescription
x-user-idnumberYesNumeric ID of the user whose notifications to retrieve.
Example request
curl http://localhost:3000/api/notificaciones \
  -H "x-user-id: 3"
Example response
[
  {
    "id": 12,
    "ordenId": 7,
    "tipo": "asignacion",
    "titulo": "Nueva orden asignada",
    "mensaje": "Se te asignó la orden #7 de Tienda López.",
    "leida": false,
    "fecha": "15 Jan 14:05"
  },
  {
    "id": 10,
    "ordenId": 5,
    "tipo": "estado",
    "titulo": "Orden #5 actualizada",
    "mensaje": "La orden de Tienda López cambió a \"Entregado\".",
    "leida": true,
    "fecha": "14 Jan 09:30"
  }
]
id
number
Unique numeric ID of the notification.
ordenId
number
ID of the order that triggered this notification, or null for informational notifications.
tipo
string
Event type: asignacion (order assigned), estado (status changed), or info (general message).
titulo
string
Short display title shown in the notification badge.
mensaje
string
Full human-readable notification body.
leida
boolean
false if the notification has not yet been viewed; true once marked as read.
fecha
string
Formatted timestamp of when the notification was created, e.g. "15 Jan 14:05".

PUT /api/notificaciones/:id/leida

Marks a single notification as read. The update only takes effect if the usuario_id on the notification matches the value in x-user-id.
Pass the user’s numeric ID in the x-user-id header to confirm ownership before marking the notification.
id
number
required
Numeric ID of the notification to mark as read.
Headers
HeaderTypeRequiredDescription
x-user-idnumberYesNumeric ID of the user who owns the notification.
Example request
curl -X PUT http://localhost:3000/api/notificaciones/12/leida \
  -H "x-user-id: 3"
Example response
{ "ok": true }

PUT /api/notificaciones/leer-todas

Marks all unread notifications as read for the requesting user in a single operation.
Pass the user’s numeric ID in the x-user-id header. If the header is missing, the request has no effect and still returns { "ok": true }.
Headers
HeaderTypeRequiredDescription
x-user-idnumberYesNumeric ID of the user whose notifications to bulk-mark as read.
Example request
curl -X PUT http://localhost:3000/api/notificaciones/leer-todas \
  -H "x-user-id: 3"
Example response
{ "ok": true }

Build docs developers (and LLMs) love