Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/astrxnomo/tourify/llms.txt

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

Notifications keep users informed of activity within Tourify. The push token endpoint stores an Expo device token against the user’s account so the backend can deliver push notifications. In-app notification records are fetched, and individually or bulk-marked as read, via the endpoints below. All notifications endpoints require authentication.

POST /api/push-token

Registers an Expo push token on the authenticated user’s account (stored in users.push_token). Call this endpoint once after the user grants notification permissions in the mobile app, and again whenever the token is refreshed by Expo.
This endpoint requires authentication. Include your bearer token in the Authorization header.
Authentication: Required (auth:sanctum).

Request Body

token
string
required
The Expo push token for the device (e.g., ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]).

Response Fields

message
string
A confirmation message. Value: "Token registrado."
Example request
curl -X POST http://localhost:8000/api/push-token \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {your-token}" \
  -H "Content-Type: application/json" \
  -d '{"token": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]"}'

GET /api/notifications

Returns all in-app notifications for the authenticated user, sorted by most recent first.
This endpoint requires authentication. Include your bearer token in the Authorization header.
Authentication: Required (auth:sanctum).

Response Fields

Returns a JSON array of notification objects.
id
integer
Unique identifier of the notification.
user_id
integer
ID of the user the notification belongs to.
notifiable_id
integer | null
ID of the related resource (e.g., an event or place), or null if the notification has no linked resource.
notifiable_type
string | null
Morph type of the related resource (e.g., App\Models\Event), or null.
title
string
Short notification title displayed in the app.
message
string | null
Body text of the notification, or null if no message was set.
is_read
boolean
true if the notification has been marked as read, false otherwise.
created_at
string (ISO 8601)
Timestamp when the notification was created.
updated_at
string (ISO 8601)
Timestamp when the notification was last updated.
Example request
curl http://localhost:8000/api/notifications \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {your-token}"

PATCH /api/notifications//read

Marks a single notification as read by setting is_read to true. Returns HTTP 403 if the notification belongs to a different user.
This endpoint requires authentication. Include your bearer token in the Authorization header.
Authentication: Required (auth:sanctum).

Path Parameters

notification
integer
required
The ID of the notification to mark as read.

Response Fields

Returns the updated notification object.
id
integer
Unique identifier of the notification.
user_id
integer
ID of the owning user.
notifiable_id
integer | null
ID of the related resource, or null.
notifiable_type
string | null
Morph type of the related resource, or null.
title
string
Short notification title.
message
string | null
Body text of the notification, or null.
is_read
boolean
Always true after a successful call to this endpoint.
created_at
string (ISO 8601)
Timestamp when the notification was created.
updated_at
string (ISO 8601)
Timestamp when the notification was last updated (will reflect the time of this request).
Returns HTTP 403 with {"message": "No autorizado."} if the notification belongs to a different user than the one making the request.
Example request
curl -X PATCH http://localhost:8000/api/notifications/18/read \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {your-token}"

PATCH /api/notifications/read-all

Marks every unread notification belonging to the authenticated user as read in a single bulk operation.
This endpoint requires authentication. Include your bearer token in the Authorization header.
Authentication: Required (auth:sanctum).
Only notifications where is_read is false are updated — already-read notifications are left untouched.

Response Fields

message
string
A confirmation message. Value: "Todas las notificaciones marcadas como leídas."
Example request
curl -X PATCH http://localhost:8000/api/notifications/read-all \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {your-token}"

Build docs developers (and LLMs) love