The Save App authentication API supports two login methods: a phone number and PIN combination for standard accounts, and a Firebase ID token for accounts verified through Google’s phone authentication service. Both methods return a JWT bearer token valid for 24 hours that you include in all subsequent authenticated requests.Documentation Index
Fetch the complete documentation index at: https://docs.digiflecttech.dev/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/auth/login
Authenticates a user with a phone number and 4-digit PIN. Optionally accepts agroupName to prevent cross-group access and a loginType to restrict portal access by role.
Request body
The user’s phone number in Uganda format. Must match the pattern
+256XXXXXXXXX (country code followed by 9 digits).The user’s 4-digit numeric PIN. Must be exactly 4 digits (e.g.,
"1234"). No letters or special characters are accepted.The name of the group to log into. When provided, the server verifies that the user belongs to this group. Use this to prevent a user from one group accidentally or maliciously accessing another group’s portal.
Restricts login to a specific portal type. Accepted values are
"admin" or "member". Passing "admin" blocks non-admin users from reaching the admin portal.Response
A signed JWT bearer token. Include this value in the
Authorization header as Bearer <token> on all subsequent authenticated requests. The token is valid for 24 hours.The user’s display name as stored in their account.
The user’s role in the group. Either
"admin" or "member".true if this user created the group, false otherwise. Group creators may have elevated permissions within admin interfaces.Error responses
| Status | Condition |
|---|---|
401 Unauthorized | Phone number not found, password does not match, or the account uses Google sign-in and cannot accept a PIN. |
403 Forbidden | Account is inactive, the user belongs to a different group than groupName, or a non-admin attempted to log in with loginType: "admin". |
POST /api/auth/firebase-login
Authenticates a user using a Firebase ID token obtained from Firebase Phone Authentication on the client. If the phone number in the decoded token does not yet have an account in the specified group, a new member account is created automatically.This endpoint is rate-limited to 10 requests per minute. Implement exponential back-off on your client when retrying after a
429 response.Request body
The Firebase ID token issued by Firebase Authentication after the client completes phone verification. Obtain this token client-side using the Firebase SDK.
The name of the group the user is logging into. Must be between 2 and 100 characters. If the phone number is new, the account is created under this group.
Response
Returns the sameLoginResponse shape as POST /api/auth/login.
Error responses
| Status | Condition |
|---|---|
400 Bad Request | The Firebase token does not contain a phone number. |
401 Unauthorized | The Firebase ID token is invalid or expired. |
403 Forbidden | The phone number is already registered under a different group than group_name, or the account is inactive. |