Documentation Index
Fetch the complete documentation index at: https://mintlify.com/hack4impact-umd/breastfeeding-center-gw/llms.txt
Use this file to discover all available pages before exploring further.
Overview
These endpoints manage dashboard user accounts stored in Firestore and Firebase Auth. Users have one of three roles (VOLUNTEER, ADMIN, DIRECTOR) encoded as custom claims on their Firebase Auth token. Role levels determine what operations each user may perform.
| Role | Level |
|---|---|
VOLUNTEER | 0 |
ADMIN | 1 |
DIRECTOR | 2 |
https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api
GET /users/all
Returns a list of all registered dashboard users. Auth required: YesExample
Response
Returns a JSON array ofUser objects.
Firebase Auth UID for the user.
User’s email address.
User’s first name.
User’s last name.
User’s pronouns (optional).
User’s phone number (optional).
User’s role:
"VOLUNTEER", "ADMIN", or "DIRECTOR".Error codes
| Status | Reason |
|---|---|
403 | Missing or invalid auth token |
GET /users/id/:auth_id
Returns a single user by their Firebase UID. Auth required: YesPath parameters
The Firebase Auth UID of the user to retrieve.
Example
Response
Returns a singleUser object (same fields as GET /users/all).
Error codes
| Status | Reason |
|---|---|
403 | Missing or invalid auth token |
404 | No user found for the given UID |
DELETE /users/id/:auth_id
Deletes a user account from both Firestore and Firebase Auth. Auth required: Yes Role-based deletion rules:- Any authenticated user may delete their own account.
- A non-
DIRECTORuser may only delete users with a strictly lower role level. - A
DIRECTORuser may delete any account. - The last remaining
DIRECTORaccount cannot be deleted; at least oneDIRECTORmust always exist.
Path parameters
The Firebase Auth UID of the user to delete.
Example
Response
Returns200 OK with an empty body on success.
Error codes
| Status | Reason |
|---|---|
400 | Missing auth_id, or deleting the last DIRECTOR is not allowed |
403 | Insufficient permissions to delete the target user |
404 | No user found for the given UID |
PUT /users/me/namepronouns
Updates the authenticated user’s first name, last name, and pronouns in Firestore. Auth required: YesBody
New first name for the user.
New last name for the user.
New pronouns. If omitted, the field is set to
null.Example
Response
Returns200 OK with the string "Name and pronouns successfully updated!".
Error codes
| Status | Reason |
|---|---|
400 | firstName or lastName is missing |
403 | Missing or invalid auth token |
PUT /users/me/email
Updates the authenticated user’s email address in both Firestore and Firebase Auth. Auth required: Yes — token must have been issued within the last 5 minutes (recent authentication required) TheoldEmail in the request body must match the email on the caller’s auth token. This prevents accidental or unauthorized email changes.
Body
The user’s current email address. Must match the email on the caller’s Firebase Auth token.
The new email address to set.
Example
Response
Returns200 OK with the string "Email successfully updated!".
Error codes
| Status | Reason |
|---|---|
400 | oldEmail or newEmail is missing |
401 | oldEmail does not match the email on the caller’s auth token |
403 | Missing or invalid auth token, or token is older than 5 minutes |
PUT /users/me/phone
Updates the authenticated user’s phone number in both Firestore and Firebase Auth. Auth required: Yes — token must have been issued within the last 5 minutes (recent authentication required)Body
The new phone number in E.164 format (e.g.
+12025551234).Example
Response
Returns200 OK with the string "Phone number successfully updated!".
Error codes
| Status | Reason |
|---|---|
400 | newPhone is missing |
403 | Missing or invalid auth token, or token is older than 5 minutes |
PUT /users/id/:id/role
Updates the role of another user. Role changes are reflected in both Firestore and as a Firebase Auth custom claim. Auth required: Yes —ADMIN or DIRECTOR role required
Role assignment rules:
- A user cannot assign a role higher than their own.
- A non-
DIRECTORuser can only update the role of users with a strictly lower role level. - A
DIRECTORuser may update any user’s role. - The last remaining
DIRECTORaccount cannot be demoted; at least oneDIRECTORmust always exist. - A user may demote their own role (self-demotion), but cannot promote themselves above their current level.
Path parameters
The Firebase Auth UID of the user whose role is being updated.
Body
The new role to assign. Must be one of
"VOLUNTEER", "ADMIN", or "DIRECTOR".Example
Response
Returns200 OK with the string "Role updated successfully".
Error codes
| Status | Reason |
|---|---|
400 | role is missing, invalid, or demoting the last DIRECTOR is not allowed |
403 | Insufficient role to perform this operation, or missing/invalid auth token |
404 | No user found for the given UID |
