Skip to main content

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

There are two registration endpoints. Neither requires a Firebase Auth token — POST /auth/register/root is protected by a shared secret, and POST /auth/register/invite/:inviteId is gated by a valid invite document in Firestore.

POST /auth/register/root

Creates the initial DIRECTOR account. This endpoint can only be called once — if a Firebase Auth user with the configured root email already exists, the request is rejected. Base URL: https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api

Headers

X-Root-Secret
string
required
The root user secret defined in the Firebase Functions config. Requests with a missing or incorrect secret are rejected with 403.

Body

email
string
required
Must exactly match the root user email in the Firebase Functions config.
firstName
string
required
First name of the root director.
lastName
string
required
Last name of the root director.
password
string
required
Password for the new Firebase Auth account.
pronouns
string
Optional pronouns stored on the user’s Firestore document.
phone
string
Optional phone number in E.164 format (e.g. +12025551234), stored in both Firebase Auth and Firestore.

Response

auth_id
string
Firebase Auth UID assigned to the new user.
email
string
Email address of the created user.
firstName
string
First name of the created user.
lastName
string
Last name of the created user.
pronouns
string | null
Pronouns, or null if not provided.
phone
string | null
Phone number, or null if not provided.
type
string
Always "DIRECTOR" for the root account.

Example

curl -X POST \
  https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/auth/register/root \
  -H "X-Root-Secret: <your-root-secret>" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "root@example.org",
    "firstName": "Admin",
    "lastName": "User",
    "password": "securepassword123"
  }'

Error codes

StatusReason
400Missing required fields, or root user already exists
403Secret does not match, or email does not match the configured root email

POST /auth/register/invite/:inviteId

Registers a new user from a valid invite. The invite must exist in Firestore, must not have been used, and must not be expired. The submitted email must match the email recorded on the invite.

Path parameters

inviteId
string
required
The UUID of the invite document in Firestore. This is included in the registration link sent via email (e.g. /register/:inviteId).

Body

email
string
required
Must exactly match the email field on the invite document.
firstName
string
required
First name for the new account.
lastName
string
required
Last name for the new account.
password
string
required
Password for the new Firebase Auth account.
pronouns
string
Optional pronouns stored on the user’s Firestore document.
phone
string
Optional phone number in E.164 format (e.g. +12025551234).

Response

auth_id
string
Firebase Auth UID assigned to the new user.
email
string
Email address of the created user.
firstName
string
First name of the created user.
lastName
string
Last name of the created user.
pronouns
string | null
Pronouns, or null if not provided.
phone
string | null
Phone number, or null if not provided.
type
string
The role assigned by the invite ("VOLUNTEER", "ADMIN", or "DIRECTOR").

Example

curl -X POST \
  https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/auth/register/invite/01930b4e-1234-7abc-8def-000000000000 \
  -H "Content-Type: application/json" \
  -d '{
    "email": "newuser@example.org",
    "firstName": "Jane",
    "lastName": "Doe",
    "password": "securepassword123"
  }'

Error codes

StatusReason
400Missing required fields, or a user with that email already exists
403Invite is expired, already used, or the submitted email does not match the invite
404No invite document found for the given inviteId

Build docs developers (and LLMs) love