Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Panahashi-Backend/llms.txt

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

The Users API manages user profiles stored in Firestore. A profile is created automatically the first time a user calls GET /api/v1/users/me after authenticating. Profiles inherit the display name and email from their Firebase Auth record.

UserProfile object

uid
string
Firebase UID.
displayName
string
Display name from Firebase Auth.
email
string
Email address.
phone
string
Phone number.
role
string
One of: CUSTOMER, BAKER, ADMIN. Default: CUSTOMER.
bakeryId
string
Linked bakery ID (set when a BAKER role user is assigned a bakery).
fcmToken
string
Firebase Cloud Messaging device token for push notifications.
createdAt
integer
Profile creation epoch ms.

GET /api/v1/users/me

Returns the authenticated user’s profile. Creates the profile automatically if it doesn’t exist yet. Auth required: Yes (any role)
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/users/me

PATCH /api/v1/users/me

Updates the authenticated user’s profile. All fields are optional. Auth required: Yes (any role)
displayName
string
New display name.
phone
string
Phone number.
fcmToken
string
FCM device token for push notifications. Update this whenever the token refreshes on the client.
curl -X PATCH \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"phone":"+57 300 123 4567","fcmToken":"device-token-xyz"}' \
  http://localhost:8080/api/v1/users/me
Always update fcmToken when your Firebase messaging token refreshes so you continue receiving push notifications.

GET /api/v1/users

Returns all user profiles sorted by display name. Auth required: Yes — ADMIN
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/users

GET /api/v1/users/bakers

Returns all users with the BAKER role. Auth required: Yes — ADMIN
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/users/bakers

GET /api/v1/users/

Returns a single user’s profile by UID. Auth required: Yes — ADMIN
uid
string
required
Firebase UID of the user.

PATCH /api/v1/users//role

Changes a user’s role. Auth required: Yes — ADMIN
uid
string
required
Firebase UID of the user.
role
string
required
New role: CUSTOMER, BAKER, or ADMIN.
curl -X PATCH \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"role":"BAKER"}' \
  http://localhost:8080/api/v1/users/uid123/role
Changing a user to BAKER does not automatically assign a bakery. An admin must create a bakery with the user’s UID as ownerId separately.

Build docs developers (and LLMs) love