Forgot Password
Initiates the forgot password flow by sending a 6-digit verification code to the user’s registered email address.Authentication
This is a public endpoint that does not require authentication.Rate Limiting
This endpoint is rate-limited to 5 requests per minute per IP address.Request Body
Registered email addressA verification code will be sent to this address if it exists in the system. The email is automatically lowercased and trimmed.Example:
[email protected]Request Example
Response
Success Response (200 OK)
Confirmation messageThe response is intentionally vague to prevent user enumeration. It returns the same message whether or not the email exists in the system.
Error Responses
429 Too Many Requests
Rate limit exceeded — More than 5 requests in 1 minute
Notes
- The verification code is valid for a limited time (typically 24 hours)
- The response is identical whether or not the email exists, to prevent account enumeration attacks
- Check your spam folder if you don’t receive the email
Reset Password
Completes the forgot password flow by providing the verification code received via email and setting a new password.Authentication
This is a public endpoint that does not require authentication.Rate Limiting
This endpoint is rate-limited to 5 requests per minute per IP address.Request Body
Username or email address of the account to resetExample:
[email protected]6-digit verification code sent via emailThis code was sent by the
/api/auth/forgot-password endpoint.Example: 123456New password to setMust be at least 8 characters long and meet Cognito password policy requirements (typically includes uppercase, lowercase, numbers, and special characters).Example:
NewP@ssw0rd!Request Example
Response
Success Response (200 OK)
Confirmation message
Error Responses
400 Bad Request
Invalid or expired verification code, or password does not meet policy requirementsOr:
429 Too Many Requests
Rate limit exceeded — More than 5 requests in 1 minute
Notes
- After successfully resetting the password, the user can log in immediately with the new password
- Verification codes expire after a set period (typically 24 hours)
- If the code is invalid or expired, request a new code using
/api/auth/forgot-password
Complete Password Change (First Login)
Completes theNEW_PASSWORD_REQUIRED challenge returned on first login when an admin has created the account with a temporary password.
Authentication
This is a public endpoint that does not require authentication. However, you must provide the session token from the login challenge response.Rate Limiting
This endpoint is rate-limited to 5 requests per minute per IP address.Request Body
Username returned in the NEW_PASSWORD_REQUIRED challengeThis is provided in the login response when
requiresPasswordChange is true.Example: [email protected]Session token returned in the NEW_PASSWORD_REQUIRED challengeThis is provided in the login response when
requiresPasswordChange is true.Example: AYABe...New permanent password to setMust be at least 8 characters long and meet Cognito password policy requirements.Example:
NewP@ssw0rd!Request Example
Response
Success Response (200 OK)
After successfully setting the new password, the user is automatically authenticated and receives tokens:Cognito JWT access token
Cognito refresh token
Token expiration time in seconds (typically 3600)
Always
false after successful password changeError Responses
400 Bad Request
Invalid session or password does not meet policy requirements
429 Too Many Requests
Rate limit exceeded — More than 5 requests in 1 minute
Notes
- This endpoint is only used during the first login after an admin creates an account
- The session token is short-lived and expires if not used promptly
- After successfully changing the password, the user is automatically logged in with full access tokens
Change Password (Authenticated)
Changes the authenticated user’s password. The user must provide their current password for verification.Authentication
Required: This endpoint requires a valid Bearer token in theAuthorization header.
Rate Limiting
This endpoint is not rate-limited.Request Body
Current (existing) password of the authenticated userMust be correct to authorize the password change.Example:
OldP@ssw0rd!New password to setMust be at least 8 characters long and meet Cognito password policy requirements.Example:
NewP@ssw0rd!Request Example
Response
Success Response (200 OK)
Confirmation message
Error Responses
400 Bad Request
New password does not meet Cognito policy requirements
401 Unauthorized
Invalid or missing Bearer token, or incorrect previous passwordOr if the token is missing/invalid:
Notes
- The current password must be provided for security verification
- After changing the password, existing access tokens remain valid until they expire
- The user does not need to log in again after changing their password
- Password policy typically requires:
- Minimum 8 characters
- At least one uppercase letter
- At least one lowercase letter
- At least one number
- At least one special character