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

Jane App does not provide a real-time API integration, so appointment and client data is imported by uploading exported spreadsheets. Once uploaded, appointments can be queried, deleted individually or in bulk, and analyzed for client retention patterns. All endpoints require a valid Firebase Auth ID token. Delete operations additionally require the ADMIN or DIRECTOR role. Base URL: https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api

POST /jane/upload

Upload Jane appointment and client data exported from Jane App. Parses the files, resolves client records against existing Firestore data, and writes appointments and updated client profiles to Firestore. Auth required: Yes
Content-Type: multipart/form-data
Accepted file formats for both fields are .csv and .xlsx.

Form fields

appointments
file
required
The Jane appointment export file (.csv or .xlsx). This field is required. The file is parsed to extract appointment records and patient identifiers.
clients
file
The Jane client export file (.csv or .xlsx). Optional. When omitted, existing Firestore client records are used for matching. When provided, the client list is rebuilt from the file and merged with existing Firestore records.

Behavior

  • Appointments are grouped by start time and clinician to resolve parent–baby relationships.
  • Each appointment group is matched to a primary client using the Jane patient number and email address.
  • Clients in the appointments file that cannot be matched to an existing Firestore record or the uploaded clients file are reported as missing — no data is written if any clients are unresolvable.
  • Client records are merged (not overwritten) in Firestore using batched writes.
  • Appointments are written to the janeAppts collection with a reference to the resolved client ID.

Example

curl -X POST \
  https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/jane/upload \
  -H "Authorization: Bearer <id_token>" \
  -F "appointments=@/path/to/appointments.csv" \
  -F "clients=@/path/to/clients.csv"

Response

Returns 200 OK with an empty body on success.

Error codes

StatusReason
400Missing appointments file, unsupported file format, or one or more clients could not be resolved
403Missing or invalid auth token
When clients are missing, the response body is a JSON object:
{
  "error": "Missing clients!",
  "details": ["First Last", "First Last"]
}

GET /jane/appointments

Query Jane appointments stored in Firestore by date range and optionally by client ID. Can optionally join each appointment with the full client profile. Auth required: Yes

Query parameters

startDate
string
ISO 8601 start of the query window (inclusive). If omitted, no lower bound is applied.
endDate
string
ISO 8601 end of the query window (inclusive). If omitted, no upper bound is applied.
includeClient
boolean
When true, each appointment in the response is enriched with the matching Client object from Firestore. When false (default), only appointment data is returned. Cannot be combined with clientId filtering.
clientId
string
Filter results to appointments belonging to a specific Firestore client ID. Only applied when includeClient is false.

Example

# Appointments in range, enriched with client data
curl "https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/jane/appointments?startDate=2024-01-01T00:00:00Z&endDate=2024-02-01T00:00:00Z&includeClient=true" \
  -H "Authorization: Bearer <id_token>"

# Appointments for a specific client
curl "https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/jane/appointments?startDate=2024-01-01T00:00:00Z&endDate=2024-02-01T00:00:00Z&clientId=abc123" \
  -H "Authorization: Bearer <id_token>"

Response

Returns a JSON array of JaneAppt objects (with an optional client field when includeClient=true).
apptId
string
Unique appointment ID from Jane.
clientId
string
Firestore client ID for the associated client.
startAt
string
Appointment start time in ISO 8601 format.
endAt
string
Appointment end time in ISO 8601 format.
visitType
string
Type of visit: "HOMEVISIT", "OFFICE", or "TELEHEALTH".
service
string
Name of the service or treatment provided.
clinician
string
Name of the clinician who provided the service.
firstVisit
boolean
Whether this was the client’s first visit.
client
Client
Full client profile object. Present only when includeClient=true.

Error codes

StatusReason
400Invalid date range or query error
403Missing or invalid auth token
500Internal error fetching appointments

DELETE /jane/appointments/:id

Delete a single Jane appointment record from Firestore by its appointment ID. Auth required: Yes — ADMIN or DIRECTOR role required

Path parameters

id
string
required
The Jane appointment ID (apptId) of the record to delete.

Example

curl -X DELETE \
  https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/jane/appointments/jane-appt-001 \
  -H "Authorization: Bearer <id_token>"

Response

Returns 200 OK with an empty body on success.

Error codes

StatusReason
400Missing appointment ID
403Missing or invalid auth token, or insufficient role

POST /jane/bulk/appointments/delete

Delete multiple Jane appointment records from Firestore in a single request. Deletions are processed in batches of up to 500 documents per Firestore batch write. Auth required: Yes — ADMIN or DIRECTOR role required

Body

ids
string[]
required
Array of Jane appointment IDs (apptId) to delete. Must contain at least one entry.

Example

curl -X POST \
  https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/jane/bulk/appointments/delete \
  -H "Authorization: Bearer <id_token>" \
  -H "Content-Type: application/json" \
  -d '{ "ids": ["appt-001", "appt-002", "appt-003"] }'

Response

Returns 200 OK with an empty body on success.

Error codes

StatusReason
400Missing or empty ids array
403Missing or invalid auth token, or insufficient role

GET /jane/retention

Returns a breakdown of first-visit clients grouped by total number of visits within the date range. Used to visualize client retention on the dashboard. Clients are bucketed 1–5 by visit count; clients with 6 or more visits are grouped into bucket 6. Appointments for "bra fitting" and "pump check" services are excluded from the first-visit filter. Auth required: Yes

Query parameters

startDate
string
ISO 8601 start of the analysis window. If omitted, no lower bound is applied.
endDate
string
ISO 8601 end of the analysis window. If omitted, no upper bound is applied.
recentChildbirth
boolean
When true, only clients who had a recent birth relative to their first visit date are included. Defaults to false.

Example

curl "https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/jane/retention?startDate=2024-01-01T00:00:00Z&endDate=2024-06-30T23:59:59Z&recentChildbirth=false" \
  -H "Authorization: Bearer <id_token>"

Response

Returns a JSON object where each key is a visit count (1–6) and each value is an array of Client objects who had that many visits in the window.
{
  "1": [ { "id": "abc", "firstName": "Jane", ... } ],
  "2": [],
  "3": [ { "id": "def", "firstName": "Alice", ... } ],
  "4": [],
  "5": [],
  "6": []
}

Error codes

StatusReason
400Invalid date range
403Missing or invalid auth token
500Internal error fetching retention data

Build docs developers (and LLMs) love