Download OpenAPI specification:Download
Multi-factor authentication API for banking platform with support for:
Authenticate user with username and password via AWS Cognito. This endpoint handles both regular users and Money Forward bot users with different authentication flows.
Flow Overview:
Flow A: Whitelisted IP (Money Forward Bot)
ip_whitelist table for the clientlogin_lists tabletwofa_enabled = TRUE): Returns tokens with session_access_state = 'restricted_access' (MFA verification is bypassed for whitelisted IPs during login, but session state reflects 2FA requirement)twofa_enabled = FALSE): Returns tokens with session_access_state = 'full_access'Flow B: Regular IP (Standard User)
login_lists tabletwofa_enabled = TRUE): Returns tokens with session_access_state = 'restricted_access' (user needs to set up 2FA method if not already configured)twofa_enabled = FALSE): Returns tokens with session_access_state = 'full_access'/call/start after loginAutomatic Migration:
custom:external_user_id attribute setUsername Format:
members_api.12345Session Access State:
full_access: User has full access to all features immediatelyrestricted_access: User has limited access until 2FA setup/verification is completed/call/start endpoint if method is phone) to gain full accessLogin Method:
password: General user login with username and passwordmoney_forward_bot: Money Forward bot login (whitelisted IP address)| Content-Type required | string application/json |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| username required | string <= 255 characters User's Cognito username. The format is determined by the calling service and must match the username used during registration. |
| password required | string <password> <= 255 characters User's password (will be verified against Legacy DB hash for first-time migration) |
{- "username": "members_api.12345",
- "password": "UserPassword123!"
}Response for whitelisted IP addresses (Money Forward Bot) when 2FA is not enabled.
{- "success": true,
- "message": "Login successful",
- "data": {
- "access_token": "eyJraWQiOiJcL3Z...",
- "id_token": "eyJraWQiOiJcL3Z...",
- "refresh_token": "eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIn0...",
- "token_type": "Bearer",
- "expires_in": 3600,
- "session_access_state": "full_access",
- "login_method": "money_forward_bot"
}
}Request password reset for a user. This endpoint initiates the password reset flow by sending a verification code to the user's email address via AWS Cognito.
Flow Overview:
mfa_users in New DB to get cognito_usernameForgotPassword API to send 6-digit verification code via emailAutomatic Migration:
auth_user table)custom:external_user_id attribute setmfa_users record exists by cognito_usernamemfa_users record with cognito_username and cognito_sub = NULL (will be set later when user logs in)Username Format:
members_api.12345Verification Code:
| Content-Type required | string application/json |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| username required | string <= 255 characters User's Cognito username in format |
{- "username": "members_api.12345"
}{- "success": true,
- "message": "Password reset code sent to your email",
- "data": null
}Confirm password reset by verifying the code sent via email and setting a new password in Cognito.
Flow Overview:
mfa_users in New DB to get cognito_usernameConfirmForgotPassword API to verify the code and set the new passwordUsername Format:
Password Requirements:
Verification Code:
Important:
Error Responses:
400 Bad Request: Returns error message describing the issue (e.g., invalid/expired verification code, invalid password format, user not found, Cognito service error)422 Validation Error: Returns validation errors for request format issues (e.g., missing required fields, invalid format)| Content-Type required | string application/json |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| username required | string <= 255 characters User's Cognito username. The format is determined by the calling service and must match the username used during registration. |
| code required | string = 6 characters 6-digit verification code received via email from Cognito |
| password required | string <password> [ 8 .. 255 ] characters New password to be set. Must meet Cognito password policy requirements. Typically: 8-30 characters, mix of uppercase, lowercase, and numbers |
{- "username": "members_api.12345",
- "code": "123456",
- "password": "NewPassword123!"
}{- "success": true,
- "message": "Password reset successful",
- "data": null
}Change user's email address in AWS Cognito. This endpoint initiates the email change process by updating the email attribute in Cognito.
Flow Overview:
UpdateUserAttributes API to update email attributeemail_verified = false until user verifies the codeImportant Notes:
email_verified = false/email/verify endpoint to complete the email change processPrerequisites:
mfa_users table)| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| new_email required | string <email> <= 255 characters New email address to change to |
{- "new_email": "newemail@example.com"
}{- "success": true,
- "message": "Verification code has been sent to your new email address",
- "data": { }
}Retrieve the current email address and verification status from Cognito for the authenticated user.
Flow Overview:
GetUser API to retrieve user attributesemail_verified statusUse Cases:
Prerequisites:
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
{- "success": true,
- "message": "string",
- "data": {
- "email": "user@example.com",
- "email_verified": false
}
}Verify the email address change by submitting the verification code sent to the new email address.
Flow Overview:
VerifyUserAttribute API to verify the codeemail_verified = trueImportant Notes:
/email/resend-verificationauth_user.email and auth_user.username)Prerequisites:
/email/change endpoint| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| verification_code required | string = 6 characters ^[0-9]{6}$ 6-digit verification code received via email from Cognito |
{- "verification_code": "123456"
}{- "success": true,
- "message": "Email address verified successfully",
- "data": { }
}Resend the verification code to the current email address in Cognito.
Flow Overview:
GetUserAttributeVerificationCode APIImportant Notes:
Prerequisites:
/email/change endpoint| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
{- "success": true,
- "message": "Verification code has been resent. Please check your email.",
- "data": { }
}Verify the validity of the current access token.
Flow Overview:
Prerequisites:
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
{- "success": true,
- "message": "Token verification successful",
- "data": { }
}Refresh the access token using a refresh token to obtain new authentication tokens.
Flow Overview:
InitiateAuth with REFRESH_TOKEN_AUTH flowlogin_method and session_access_state are inherited from the previous login sessionPrerequisites:
| Content-Type required | string application/json |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| username required | string <= 255 characters User's Cognito username. The format is determined by the calling service and must match the username used during login. |
| refresh_token required | string Cognito refresh token from previous authentication |
{- "username": "members_api.12345",
- "refresh_token": "eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIn0..."
}{- "success": true,
- "message": "Token refreshed successfully",
- "data": {
- "access_token": "eyJraWQiOiJcL3Z...",
- "id_token": "eyJraWQiOiJcL3Z...",
- "token_type": "Bearer",
- "expires_in": 3600,
- "session_access_state": "full_access",
- "login_method": "password"
}
}Register a new user in AWS Cognito and create MFA user record.
Flow Overview:
external_user_id2FA Settings for New Users:
twofa_enabled = TRUE and twofa_method = NULLsession_access_state = 'restricted_access' and must set up a 2FA method (phone or passkey) to gain full accessUsername Format:
members_api.12345Password Requirements:
On success, the user is confirmed in Cognito and ready for subsequent authentication and MFA flows.
| Content-Type required | string application/json |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| external_user_id required | string External user identifier from the calling service |
| username required | string <= 255 characters Cognito username to be used for the user. The format is determined by the calling service and must be unique within the Cognito User Pool. This username will be stored in the mfa_users table as cognito_username. |
| email required | string <email> <= 255 characters User's email address |
| password required | string <password> [ 8 .. 255 ] characters User's password. Must meet Cognito password policy requirements. Typically: 8-30 characters, mix of uppercase, lowercase, and numbers |
{- "external_user_id": "12345",
- "username": "members_api.12345",
- "email": "user@example.com",
- "password": "SecurePassword123!"
}{- "success": true,
- "message": "User registered successfully",
- "data": null
}Switch user session from current account (User A) to a linked account (User B). This endpoint is called by members-api after validating the relationship between User A and User B.
Flow Overview:
mfa_users)AdminCreateUser with:email_verified = truecustom:external_user_id = target_external_user_idMessageAction = SUPPRESSFORCE_CHANGE_PASSWORD state (AdminCreateUser bypasses PreSignUp Lambda)custom:external_user_id attribute setcognito_sub using AdminGetUser APImfa_users record with cognito_sub already setCUSTOM_AUTH flow with:USERNAME = target_username (cognito username)ClientMetadata: {target_id, current_id} (both are members.id from Legacy DB)CUSTOM_CHALLENGEtarget_id and current_idtarget_id and current_idsub (cognito_sub) from User A's AccessToken (from Authorization header, already validated in middleware)mfa_users table using cognito_sub = sub to find User A's mfa_users.idmfa_users table:switched_by_id = User A's mfa_users.idsession_access_state = 'full_access' (2FA is bypassed for switch-user)mfa_users.client_id if NULLsession_access_state = 'full_access'Important Notes:
member_linkages table)current_id, target_id, target_username, target_email, target_external_user_id)member_linkages table) using target_id and current_id (both are members.id)Username Format:
members_api.{external_user_id}members_api.12345Automatic Migration:
target_username (cognito username)target_email (email address)target_external_user_id (external user identifier)email_verified = true, custom:external_user_id = target_external_user_id, and in FORCE_CHANGE_PASSWORD statemfa_users record is created with cognito_sub already setSession Access State:
full_access: User has full access immediately (2FA is bypassed for switch-user)switched_by_id is setsession_access_state is always set to 'full_access' after successful switch, regardless of 2FA settingsLogin Method:
switch_user: Account switching between linked accounts| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| current_id required | integer
|
| target_id required | integer
|
| target_username required | string <= 255 characters Cognito username for User B in format |
| target_email required | string <email> <= 255 characters Email address of User B. This email is retrieved by members-api from legacy database before calling this endpoint. |
| target_external_user_id required | string <= 255 characters External user identifier for User B.
This identifier is retrieved by members-api from |
{- "current_id": 12345678,
- "target_id": 87654321,
- "target_username": "members_api.12345",
- "target_email": "userb@example.com",
- "target_external_user_id": "12345"
}Response for successful account switch. 2FA is bypassed and user gets full access immediately.
{- "success": true,
- "message": "Account switched successfully",
- "data": {
- "access_token": "eyJraWQiOiJ...",
- "id_token": "eyJraWQiOiJ...",
- "refresh_token": "eyJjdHkiOiJ...",
- "token_type": "Bearer",
- "expires_in": 3600,
- "session_access_state": "full_access",
- "login_method": "switch_user"
}
}Retrieve current authentication method configuration for the logged-in user. Returns password status, 2FA settings, phone verification status, and passkey count.
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
{- "success": true,
- "message": "string",
- "data": {
- "password_enabled": true,
- "twofa_enabled": true,
- "twofa_method": "phone",
- "phone_verified_at": "2024-12-01T10:30:00Z",
- "passkey_enabled": false,
- "passkey_count": 0
}
}Update user's authentication method configuration with password re-authentication.
This endpoint is used when a user who is currently logged in with password authentication wants to change their MFA settings. Before allowing the settings change, the system requires the user to re-authenticate using their password to verify their identity.
Flow Overview:
Identity Verification:
MFA Settings Options (for users logged in with password):
phone (phone call 2FA for password login)passkey (switch to passkey authentication)MFA Settings Format:
twofa_enabled: Boolean to enable/disable 2FAtwofa_method: String enum (phone or passkey) to specify the 2FA methodNote: This endpoint is specifically for users who are currently logged in with password authentication.
Validation rules:
twofa_enabled and twofa_method are required in mfa_settingstwofa_method is phone: 2FA (Caller ID) requires verified phone numbertwofa_method is passkey: User must have at least one registered passkey device| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| password required | string <password> Current user password for identity verification |
required | object The MFA settings configuration to apply after successful password verification. These settings will only be updated if password verification succeeds. |
User enables password authentication with phone call 2FA after password verification
{- "password": "user_password",
- "mfa_settings": {
- "twofa_enabled": true,
- "twofa_method": "phone"
}
}Response when user successfully enables passkey authentication
{- "success": true,
- "message": "Your authentication settings have been updated successfully",
- "data": {
- "password_enabled": false,
- "twofa_enabled": true,
- "passkey_enabled": true,
- "twofa_method": "passkey",
- "passkey_count": 1,
- "phone_verified_at": "2024-12-01T10:30:00Z",
- "updated_at": "2024-12-01T15:45:00Z"
}
}Retrieve detailed information about phone-based 2FA settings (phone number, country code, and verification timestamp) for the authenticated user
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
{- "success": true,
- "message": "string",
- "data": {
- "phone_number": "+81234567890",
- "phone_country_code": "+81",
- "phone_verified_at": "2019-08-24T14:15:22Z"
}
}Initiate phone number registration for new users
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| phone_number required | string Phone number to register |
| phone_country_code required | string Country code (e.g., +81) |
{- "phone_number": "string",
- "phone_country_code": "string"
}{- "success": true,
- "message": "string",
- "data": {
- "phone_system_session_id": "99be3bdc-8b13-4d51-b642-2b9230f839d2",
- "dedicated_phone_number": "050-3159-5552",
- "current_phone_call": "080-2564-6378",
- "waiting_since": "2019-08-24T14:15:22Z",
- "waiting_until": "2019-08-24T14:15:22Z"
}
}Retrieve status of phone verification process.
| phone_system_session_id required | string <uuid> Session ID from phone system |
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
{- "success": true,
- "message": "string",
- "data": {
- "phone_system_session_id": "e995910b-651e-4a22-963b-eb57323fa74d",
- "status": "success"
}
}Initiate phone call verification for 2FA
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| context_type required | string Context for phone verification (e.g., 'payment', 'login', 'fund_confirmation', 'deposit') |
{- "context_type": "string"
}{- "success": true,
- "message": "string",
- "data": {
- "phone_system_session_id": "99be3bdc-8b13-4d51-b642-2b9230f839d2",
- "dedicated_phone_number": "050-3159-5552",
- "current_phone_call": "080-2564-6378",
- "waiting_since": "2019-08-24T14:15:22Z",
- "waiting_until": "2019-08-24T14:15:22Z"
}
}Verify password and initiate phone call verification to update MFA settings.
This endpoint is used when a user who is currently logged in with password + 2FA phone call authentication wants to change their MFA settings (e.g., switch to passkey). Before allowing the settings change, the system requires the user to:
Flow Overview:
/call/status endpoint/call/update-mfa-settings/finish to complete the MFA settings updateIdentity Verification:
Prerequisites:
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| password required | string <password> Current user password for identity verification |
User provides password to initiate phone call verification for MFA settings update
{- "password": "user_password"
}{- "success": true,
- "message": "string",
- "data": {
- "phone_system_session_id": "99be3bdc-8b13-4d51-b642-2b9230f839d2",
- "dedicated_phone_number": "050-3159-5552",
- "current_phone_call": "080-2564-6378",
- "waiting_since": "2019-08-24T14:15:22Z",
- "waiting_until": "2019-08-24T14:15:22Z"
}
}Complete MFA settings update after successful phone call verification.
This endpoint is called after the user has successfully completed phone call verification via /call/status endpoint.
The endpoint updates the MFA settings with the provided configuration.
Flow Overview:
/call/status endpoint)MFA Settings Options (for users logged in with password + 2FA phone call):
twofa_enabled: true, twofa_method: "passkey")twofa_enabled: false or twofa_method: null (returns 400 Bad Request with CANNOT_DISABLE_2FA error)MFA Settings Format:
twofa_enabled: Boolean to enable/disable 2FA (must be true for this endpoint - cannot disable 2FA)twofa_method: String enum (passkey) to specify the 2FA method. Must be passkey when switching to passkey authenticationValidation rules:
twofa_enabled and twofa_method are required in mfa_settingstwofa_enabled must be true (cannot disable 2FA once enabled)| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
required | object The MFA settings configuration to apply after successful phone call verification. These settings will only be updated if phone call verification was successful. |
User switches from password + 2FA phone call to passkey authentication
{- "mfa_settings": {
- "twofa_enabled": true,
- "twofa_method": "passkey"
}
}Response when user successfully switches from password + 2FA phone call to passkey authentication
{- "success": true,
- "message": "Your authentication settings have been updated successfully",
- "data": {
- "password_enabled": false,
- "twofa_enabled": true,
- "twofa_method": "passkey",
- "passkey_enabled": true,
- "passkey_count": 1,
- "phone_verified_at": null,
- "updated_at": "2024-12-01T15:45:00Z"
}
}Initiate phone number change process.
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| new_phone_number required | string |
| phone_country_code required | string |
{- "new_phone_number": "string",
- "phone_country_code": "string"
}{- "success": true,
- "message": "string",
- "data": {
- "phone_system_session_id": "99be3bdc-8b13-4d51-b642-2b9230f839d2",
- "dedicated_phone_number": "050-3159-5552",
- "current_phone_call": "080-2564-6378",
- "waiting_since": "2019-08-24T14:15:22Z",
- "waiting_until": "2019-08-24T14:15:22Z"
}
}Cancel ongoing phone verification process
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| phone_system_session_id required | string <uuid> |
{- "phone_system_session_id": "e995910b-651e-4a22-963b-eb57323fa74d"
}{- "success": true,
- "message": "string",
- "data": { }
}Verify external ID and initiate recovery process.
Flow:
| Content-Type required | string application/json |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| username required | string <= 255 characters User's username in format |
| password | string <password> <= 255 characters User's password |
{- "username": "members_api.12345",
- "password": "UserPassword123!"
}{- "success": true,
- "message": "Recovery verification successful",
- "data": {
- "phone_number": "080-9675-1234",
- "phone_country_code": "+81"
}
}Initiate phone verification for account recovery (e.g., lost passkey)
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
{- "success": true,
- "message": "string",
- "data": {
- "phone_system_session_id": "99be3bdc-8b13-4d51-b642-2b9230f839d2",
- "dedicated_phone_number": "050-3159-5552",
- "current_phone_call": "080-2564-6378",
- "waiting_since": "2019-08-24T14:15:22Z",
- "waiting_until": "2019-08-24T14:15:22Z"
}
}Retrieve status of phone verification process during account recovery (login recovery).
| phone_system_session_id required | string <uuid> Session ID from phone system used for recovery |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
{- "success": true,
- "message": "string",
- "data": {
- "phone_system_session_id": "e995910b-651e-4a22-963b-eb57323fa74d",
- "status": "success"
}
}Cancel ongoing phone verification process during account recovery (login recovery).
| Content-Type required | string application/json |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| phone_system_session_id required | string <uuid> |
{- "phone_system_session_id": "e995910b-651e-4a22-963b-eb57323fa74d"
}{- "success": true,
- "message": "string",
- "data": { }
}Initialize passkey verification for authenticated users. Always returns a WebAuthn challenge response.
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
{- "success": true,
- "message": "Passkey verification initialized successfully",
- "data": {
- "ChallengeName": "WEB_AUTHN",
- "ChallengeParameters": {
- "challenge": "base64-encoded-challenge-data",
- "rpId": "your-app-domain.com",
- "userId": "cognito-user-id",
- "userVerification": "preferred",
- "challengeType": "webauthn"
}, - "Session": "session-token-for-challenge-response",
- "AvailableChallenges": [
- "WEB_AUTHN"
]
}
}Finish passkey verification and receive auth code
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| session_id required | string Session token from Cognito |
| challenge_name required | string Value: "WEB_AUTHN" Challenge name (should be 'WEB_AUTHN') |
required | object |
{- "session_id": "AQECAHjv...long-session-string-from-cognito",
- "challenge_name": "WEB_AUTHN",
- "challenge_response": {
- "username": "user@example.com",
- "credential": {
- "id": "credential-id-from-webauthn",
- "rawId": "base64-encoded-raw-id",
- "response": {
- "clientDataJSON": "base64-encoded-client-data",
- "authenticatorData": "base64-encoded-authenticator-data",
- "signature": "base64-encoded-signature",
- "userHandle": null
}, - "type": "public-key"
}
}
}{- "success": true,
- "message": "Passkey verified successfully",
- "data": {
- "session_id": "123e4567-e89b-12d3-a456-426614174000"
}
}Initialize passkey re-authentication challenge for updating MFA settings.
This endpoint is used when a user who is currently logged in with passkey authentication wants to change their MFA settings. Before allowing the settings change, the system requires the user to re-authenticate using their passkey to verify their identity.
Flow Overview:
/passkey/update-mfa-settings/finish endpointPrerequisites:
Response:
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
{- "success": true,
- "message": "Passkey verification initialized successfully",
- "data": {
- "ChallengeName": "WEB_AUTHN",
- "ChallengeParameters": {
- "challenge": "base64-encoded-challenge-data",
- "rpId": "your-app-domain.com",
- "userId": "cognito-user-id",
- "userVerification": "preferred",
- "challengeType": "webauthn"
}, - "Session": "session-token-for-challenge-response",
- "AvailableChallenges": [
- "WEB_AUTHN"
]
}
}Verify passkey signature and update MFA settings.
This endpoint is used when a user who is currently logged in with passkey authentication wants to change their MFA settings. Before allowing the settings change, the system requires the user to re-authenticate using their passkey to verify their identity.
Flow Overview:
/passkey/update-mfa-settings/start to get a WebAuthn challengemfa_settings configurationIdentity Verification:
MFA Settings Update:
mfa_settings object contains the new configuration that will be applied after successful passkey verificationMFA Settings Options (for users logged in with passkey):
twofa_enabled: false, twofa_method: null)twofa_enabled: true, twofa_method: "phone")MFA Settings Format:
twofa_enabled: Boolean to enable/disable 2FAtwofa_method: String enum (phone or null) to specify the 2FA method. Set to null when disabling 2FA (switching to only password)| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| session_id required | string Session token from /passkey/update-mfa-settings/start |
required | object |
required | object The MFA settings configuration to apply after successful passkey verification. These settings will only be updated if passkey verification succeeds. |
User switches from passkey to only password authentication (no 2FA)
{- "session_id": "AQECAHjv...long-session-string-from-cognito",
- "challenge_response": {
- "username": "user@example.com",
- "credential": {
- "id": "credential-id-from-webauthn",
- "rawId": "base64-encoded-raw-id",
- "response": {
- "clientDataJSON": "base64-encoded-client-data",
- "authenticatorData": "base64-encoded-authenticator-data",
- "signature": "base64-encoded-signature",
- "userHandle": null
}, - "type": "public-key"
}
}, - "mfa_settings": {
- "twofa_enabled": false,
- "twofa_method": null
}
}Response when user successfully switches from passkey to only password authentication (no 2FA)
{- "success": true,
- "message": "Your authentication settings have been updated successfully",
- "data": {
- "password_enabled": true,
- "twofa_enabled": false,
- "twofa_method": null,
- "passkey_enabled": false,
- "passkey_count": 0,
- "phone_verified_at": null,
- "updated_at": "2024-12-01T15:45:00Z"
}
}Retrieve list of all registered passkey devices for the authenticated user. Returns device name, creation date, and last used timestamp for each passkey.
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
{- "success": true,
- "message": "Passkey list retrieved successfully",
- "data": {
- "passkeys": [
- {
- "id": 1,
- "device_name": "MacBook Pro 2024",
- "created_at": "2024-11-15T10:30:00Z",
- "last_used_at": "2026-01-19T14:20:00Z"
}
]
}
}Update the display name of a registered passkey device. User can only rename their own passkeys.
Validation rules:
| id required | integer >= 1 Passkey device ID to rename |
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| device_name required | string [ 1 .. 255 ] characters New display name for the passkey device |
{- "device_name": "Home MacBook Pro"
}{- "success": true,
- "message": "Passkey name has been saved",
- "data": {
- "id": 1,
- "device_name": "Home MacBook Pro",
- "updated_at": "2026-01-20T10:30:00Z"
}
}Initialize passkey registration with WebAuthn challenge from Cognito
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
{- "success": true,
- "message": "string",
- "data": {
- "session": {
- "session_id": "string",
- "expires_at": "2019-08-24T14:15:22Z"
}, - "webauthn_options": {
- "challenge": "string",
- "rp": {
- "name": "string",
- "id": "string"
}, - "user": {
- "id": "string",
- "name": "string",
- "displayName": "string"
}, - "pubKeyCredParams": [
- {
- "type": "public-key",
- "alg": -7
}
], - "timeout": 60000,
- "excludeCredentials": [
- { }
], - "authenticatorSelection": {
- "authenticatorAttachment": "platform",
- "requireResidentKey": false,
- "residentKey": "preferred",
- "userVerification": "preferred"
}, - "attestation": "none"
}
}
}Finish passkey registration with WebAuthn credential
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| session_id required | string <uuid> <= 255 characters Session ID from registration start |
required | object (WebAuthnRegistrationCredential) |
{- "session_id": "1ffd059c-17ea-40a8-8aef-70fd0307db82",
- "credential": {
- "id": "string",
- "rawId": "string",
- "response": {
- "clientDataJSON": "string",
- "attestationObject": "string"
}, - "type": "public-key"
}
}{- "success": true,
- "message": "Passkey registered successfully",
- "data": {
- "session_id": "550e8400-e29b-41d4-a716-446655440000",
- "device": {
- "id": 1,
- "device_name": "Chrome on macOS",
- "credential_id": "string",
- "created_at": "2019-08-24T14:15:22Z"
}, - "user": {
- "twofa_enabled": true,
- "twofa_method": "passkey"
}
}
}Called when user cancels the passkey registration, adding, or deletion process after the challenge is issued but before completion. This API marks the challenge as cancelled to prevent replay attacks and logs the cancellation event.
Note:
/passkey/login/cancel endpoint instead.Authentication:
Prerequisites:
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| session_id required | string <uuid> Session ID from passkey registration start |
{- "session_id": "550e8400-e29b-41d4-a716-446655440000"
}{- "success": true,
- "message": "Passkey challenge cancelled successfully",
- "data": {
- "session_id": "550e8400-e29b-41d4-a716-446655440000",
- "status": "cancelled",
- "cancelled_at": "2026-01-21T10:30:00Z"
}
}Initialize passkey login and generate WebAuthn challenge.
Flow Overview:
mfa_users to verify user has passkey authentication enabled (twofa_enabled=TRUE, twofa_method='passkey')passkey_devices to get list of registered passkey credential IDsInitiateAuth with PREFERRED_CHALLENGE: WEB_AUTHN to generate WebAuthn challengepasskey_challenges tablePrerequisites:
POST /members/login before calling this endpointtwofa_enabled=TRUE, twofa_method='passkey')Error Responses:
401 INVALID_CREDENTIALS: User not found in mfa_users or member disabled/restricted401 NO_PASSKEY_DEVICES: No passkey devices found for this user401 INVALID_CLIENT_TOKEN: Access-Token header is missing, invalid, or expired| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
Passkey login start request
| username required | string <= 255 characters Cognito username used for passkey login. Expected format: "members_api.{external_id}" returned from members-api. |
{- "username": "members_api.123456"
}{- "success": true,
- "message": "string",
- "data": {
- "ChallengeName": "WEB_AUTHN",
- "ChallengeParameters": {
- "challenge": "string",
- "rpId": "string",
- "userId": "string",
- "userVerification": "preferred",
- "challengeType": "webauthn"
}, - "Session": "string",
- "AvailableChallenges": [
- "WEB_AUTHN"
], - "credential_ids": [
- "credential-id-1",
- "credential-id-2"
]
}
}Verify WebAuthn assertion and complete passkey login to receive Cognito tokens.
Flow Overview:
RespondToAuthChallenge to verify the signaturemfa_users.session_access_state = 'full_access' (passkey authentication provides full 2FA verification)last_used_at timestampSession Access State:
full_access: Always set for passkey loginLogin Method:
passkey: Passkey (WebAuthn) authentication| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
WebAuthn challenge response containing session_id, challenge_name, and challenge_response with credential assertion
| session_id required | string <= 500 characters |
| challenge_name required | string <= 50 characters Value: "WEB_AUTHN" |
required | object |
{- "session_id": "string",
- "challenge_name": "WEB_AUTHN",
- "challenge_response": {
- "username": "string",
- "credential": {
- "id": "string",
- "rawId": "string",
- "response": {
- "clientDataJSON": "string",
- "authenticatorData": "string",
- "signature": "string",
- "userHandle": "string"
}, - "type": "public-key"
}
}
}{- "success": true,
- "message": "string",
- "data": {
- "access_token": "string",
- "id_token": "string",
- "refresh_token": "string",
- "token_type": "Bearer",
- "expires_in": 3600,
- "session_access_state": "full_access",
- "login_method": "passkey"
}
}Called when user cancels the passkey login process after the challenge is issued but before completion. This API marks the challenge as cancelled to prevent replay attacks and logs the cancellation event.
Authentication:
Flow Overview:
Prerequisites:
/passkey/login/start endpoint| Content-Type required | string application/json |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| session_id required | string <uuid> Session ID from passkey login start |
{- "session_id": "550e8400-e29b-41d4-a716-446655440000"
}{- "success": true,
- "message": "Passkey login challenge cancelled successfully",
- "data": {
- "session_id": "550e8400-e29b-41d4-a716-446655440000",
- "status": "cancelled",
- "cancelled_at": "2026-01-21T10:30:00Z"
}
}Initialize passkey deletion with 2FA verification
| id required | integer >= 1 Passkey device ID to delete |
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
{- "success": true,
- "message": "string",
- "data": {
- "passkey_devices": {
- "id": 1,
- "device_name": "string"
}, - "ChallengeName": "WEB_AUTHN",
- "ChallengeParameters": {
- "challenge": "string",
- "rpId": "string",
- "userId": "string",
- "userVerification": "preferred",
- "challengeType": "webauthn"
}, - "session_id": "string",
- "currentCredential": "credential-id-123",
- "AvailableChallenges": [
- "WEB_AUTHN"
]
}
}Finish passkey deletion with WebAuthn verification
| id required | integer >= 1 Passkey device ID to delete |
| Authorization required | string Bearer Cognito AccessToken authentication token (format: Bearer {token}) |
| Content-Type required | string application/json |
| User-Agent | string Browser/App identifier for audit logging |
| X-Device-Fingerprint | string^[a-f0-9]{64}$ SHA-256 device fingerprint for trusted device management |
| X-Forwarded-For | string Client IP address for IP whitelist checking and audit logging |
| session_id required | string <= 500 characters |
| challenge_name required | string <= 50 characters Value: "WEB_AUTHN" |
required | object |
{- "session_id": "string",
- "challenge_name": "WEB_AUTHN",
- "challenge_response": {
- "username": "string",
- "credential": {
- "id": "string",
- "rawId": "string",
- "response": {
- "clientDataJSON": "string",
- "authenticatorData": "string",
- "signature": "string",
- "userHandle": "string"
}, - "type": "public-key"
}
}
}{- "success": true,
- "message": "string",
- "data": {
- "device": {
- "id": 1,
- "device_name": "MacBook Pro"
}, - "is_current_device": false
}
}Retrieve list of users with MFA enabled or registered. Used by administrators to search and select users for 2FA management.
Required permissions: Security Admin role
Returns:
| page | integer >= 1 Default: 1 Page number (default 1) |
| per_page | integer [ 1 .. 100 ] Default: 20 Number of items per page (default 20, max 100) |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| Content-Type required | string application/json |
{- "success": true,
- "message": "MFA user list retrieved successfully",
- "data": [
- {
- "mfa_user_id": "22",
- "username": "adminuser1",
- "twofa_enabled": true,
- "twofa_method": "passkey",
- "phone_number": "090-****-1234",
- "passkey_count": 2,
- "updated_at": "2024-01-20T09:00:00Z"
}
], - "meta": {
- "current_page": 1,
- "per_page": 20,
- "total": 100,
- "last_page": 5
}, - "links": {
- "next": "/admin/mfa-users?page=2&per_page=20",
- "prev": null
}
}Retrieve user's security settings for admin view. Returns current 2FA status, authentication methods, and passkey devices.
Required permissions: Security Admin role
Returns:
| mfa_user_id required | string Example: 22 External user identifier from the calling service |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| Content-Type required | string application/json |
{- "success": true,
- "message": "string",
- "data": {
- "mfa_user_id": "22",
- "twofa_enabled": true,
- "twofa_method": "passkey",
- "phone_number": "090-****-1234",
- "phone_country_code": "+81",
- "phone_verified_at": "2024-01-15T10:30:00Z",
- "passkey_devices": [
- {
- "id": 123,
- "device_name": "iPhone 15",
- "last_used_at": "2024-01-20T08:15:00Z",
- "created_at": "2024-01-10T14:20:00Z"
}
], - "updated_at": "2024-01-20T09:00:00Z"
}
}Update user's security settings (admin only).
Required permissions: Security Admin role
Supported operations:
| mfa_user_id required | string Example: 22 External user identifier from the calling service |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| Content-Type required | string application/json |
| twofa_enabled | boolean Enable or disable 2FA |
| twofa_method | string Enum: "passkey" "phone" Set 2FA method |
{- "twofa_enabled": true,
- "twofa_method": "passkey"
}{- "success": true,
- "message": "Settings updated successfully",
- "data": { }
}Change the phone number for a specified user. Only administrators with Security Admin role can perform this action.
Required permissions: Security Admin role
Audit: All changes are logged with operator and target info.
| mfa_user_id required | string Example: 22 MFA user ID (external_user_id) |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| Content-Type required | string application/json |
| phone_number required | string New phone number to set |
| phone_country_code required | string Country code (e.g., +81) |
{- "phone_number": "09012345678",
- "phone_country_code": "+81"
}{- "success": true,
- "message": "Phone number updated successfully",
- "data": { }
}Remove the phone number for a specified user. Only administrators with Security Admin role can perform this action.
Required permissions: Security Admin role
Audit: All delete actions are logged with operator and target info.
| mfa_user_id required | string Example: 22 MFA user ID (external_user_id) |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| Content-Type required | string application/json |
{- "success": true,
- "message": "Phone number deleted successfully",
- "data": { }
}Delete (soft delete) 1 passkey devices for the specified user. Only administrators with Security Admin role can perform this action.
Required permissions: Security Admin role
Audit: All delete actions are logged with operator and target info.
| mfa_user_id required | string Example: 22 MFA user ID (external_user_id) |
| passkey_id required | string Example: 121 Passkey device ID |
| Access-Token required | string Access token from Cognito OAuth2 for Client |
| Content-Type required | string application/json |
{- "success": true,
- "message": "Passkeys deleted successfully",
- "data": { }
}Webhook endpoint for phone call verification status updates
| transaction_id required | string <uuid> Transaction UUID from Phone System (matches call_sessions.phone_system_session_id) |
| status required | string Enum: "started" "succeeded" "calledlate" "timedout" "expired" "rejected" Verification status |
| authentic_number required | string Phone number to be verified |
| customer_number required | string or null Caller ID from Phone System (not returned on timeout) |
| identifier required | string or null Optional identifier set by 2FA system |
{- "transaction_id": "99be3bdc-8b13-4d51-b642-2b9230f839d2",
- "status": "succeeded",
- "authentic_number": "+81234567890",
- "customer_number": "+81234567890",
- "identifier": "optional-identifier-123"
}{- "success": true,
- "message": "Webhook processed successfully",
- "data": [ ]
}