Banker MFA Authentication API (1.0.0)

Download OpenAPI specification:Download

Multi-factor authentication API for banking platform with support for:

  • Passkey (WebAuthn) authentication
  • Phone call verification
  • AWS Cognito integration
  • Multi-tenant client support

Health

Health check endpoints

Health check

Returns the health status of the API

Responses

Response samples

Content type
application/json
{
  • "status": "healthy",
  • "timestamp": "2019-08-24T14:15:22Z"
}

User Authentication

User login, password reset, email management, and account recovery

User login with automatic migration and MFA support

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:

  1. Receives username and password from client
  2. Verifies client token (Access-Token)
  3. Extracts source IP address from X-Forwarded-For header
  4. Checks IP whitelist (ip_whitelist table for the client)
  5. Routes to appropriate flow based on IP whitelist status

Flow A: Whitelisted IP (Money Forward Bot)

  • IP address is registered in ip_whitelist table for the client
  • Checks account lock status in login_lists table
  • Bypasses MFA/2FA verification requirements (no phone call verification needed during login)
  • Bypasses password-disabled settings (twofa_enabled/passkey checks)
  • Password validation is sufficient for authentication
  • After successful authentication, checks 2FA settings:
    • If 2FA is enabled (twofa_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)
    • If 2FA is not enabled (twofa_enabled = FALSE): Returns tokens with session_access_state = 'full_access'

Flow B: Regular IP (Standard User)

  • IP address is not whitelisted
  • Checks account lock status in login_lists table
  • Checks if passkey authentication is enabled (twofa_enabled = TRUE AND twofa_method = 'passkey')
    • If passkey auth enabled, returns 401 Unauthorized with message "Invalid username or password"
  • If password auth allowed, initiates Cognito authentication
  • After successful password authentication, checks 2FA settings:
    • If 2FA is enabled (twofa_enabled = TRUE): Returns tokens with session_access_state = 'restricted_access' (user needs to set up 2FA method if not already configured)
    • If 2FA is not enabled (twofa_enabled = FALSE): Returns tokens with session_access_state = 'full_access'
  • Phone verification (if 2FA is enabled and method is phone) is handled via separate endpoint /call/start after login

Automatic Migration:

  • If user does not exist in Cognito, Cognito automatically triggers User Migration Lambda:
    • Lambda verifies user against Legacy DB (auth_user table)
    • Lambda verifies password hash: SHA1(SECURITY_SALT + password)
    • Lambda returns user attributes to Cognito (email, username, email_verified=true, custom:external_user_id)
    • Cognito automatically creates the user in User Pool (FinalUserStatus=CONFIRMED, MessageAction=SUPPRESS) with custom:external_user_id attribute set
    • Lambda gets cognito_sub from Cognito (AdminGetUser API)
    • Lambda checks if mfa_users record exists (by cognito_username)
    • If record exists: Lambda updates mfa_users record with cognito_sub
    • If record does not exist: Lambda creates mfa_users record with cognito_sub already set
  • After successful authentication, system updates mfa_users record with client_id (if NULL)

Username Format:

  • Username format is determined by the calling service
  • Example: members_api.12345

Session Access State:

  • full_access: User has full access to all features immediately
    • Set for whitelisted IPs (Money Forward Bot) when 2FA is not enabled
    • Set for regular users when 2FA is not enabled
  • restricted_access: User has limited access until 2FA setup/verification is completed
    • Set for whitelisted IPs (Money Forward Bot) when 2FA is enabled (MFA verification is bypassed for whitelisted IPs during login, but session state reflects 2FA requirement)
    • Set for regular users when 2FA is enabled (user needs to set up 2FA method if not already configured)
    • User must complete 2FA setup/verification (e.g., phone verification via /call/start endpoint if method is phone) to gain full access
    • Restricted access prevents sensitive operations (e.g., fund applications, deposit refunds)

Login Method:

  • password: General user login with username and password
  • money_forward_bot: Money Forward bot login (whitelisted IP address)
Authorizations:
ClientAccessToken
header Parameters
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

Request Body schema: application/json
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)

Responses

Request samples

Content type
application/json
{
  • "username": "members_api.12345",
  • "password": "UserPassword123!"
}

Response samples

Content type
application/json
Example

Response for whitelisted IP addresses (Money Forward Bot) when 2FA is not enabled.

{
  • "success": true,
  • "message": "Login successful",
  • "data": {
    }
}

Request password reset via Cognito

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:

  1. Receives Cognito username from the calling service
  2. Verifies client token (Access-Token)
  3. Queries mfa_users in New DB to get cognito_username
  4. Calls AWS Cognito ForgotPassword API to send 6-digit verification code via email

Automatic Migration:

  • If user does not exist in Cognito, Cognito automatically triggers User Migration Lambda:
    • Lambda looks up user in Legacy DB (auth_user table)
    • Lambda returns user attributes to Cognito (email, username, email_verified=true, custom:external_user_id)
    • Cognito creates the user in User Pool (FinalUserStatus=CONFIRMED, MessageAction=SUPPRESS) with custom:external_user_id attribute set
    • After Cognito creates user, auth-api checks if mfa_users record exists by cognito_username
    • If record exists: No update needed, skip (cognito_sub will be set when user logs in)
    • If record does not exist: Create new mfa_users record with cognito_username and cognito_sub = NULL (will be set later when user logs in)
  • After migration, Cognito sends verification code via email

Username Format:

  • Username format is determined by the calling service
  • Example: members_api.12345

Verification Code:

  • Cognito sends a 6-digit verification code to the user's registered email address
  • The code expires after a configured time (typically 15 minutes)
  • User must use this code in the confirm-forgot-password endpoint to reset their password
Authorizations:
ClientAccessToken
header Parameters
Content-Type
required
string

application/json

Access-Token
required
string

Access token from Cognito OAuth2 for Client

Request Body schema: application/json
username
required
string <= 255 characters

User's Cognito username in format members_api.{external_id}. Example: members_api.12345

Responses

Request samples

Content type
application/json
{
  • "username": "members_api.12345"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Password reset code sent to your email",
  • "data": null
}

Confirm password reset with verification code

Confirm password reset by verifying the code sent via email and setting a new password in Cognito.

Flow Overview:

  1. Receives Cognito username, verification code, and new password from the calling service
  2. Verifies client token (Access-Token)
  3. Queries mfa_users in New DB to get cognito_username
  4. Calls AWS Cognito ConfirmForgotPassword API to verify the code and set the new password
  5. If code is valid, Cognito password is updated
  6. After successful Cognito update, the calling service is responsible for updating the legacy database password

Username Format:

  • Username format is determined by the calling service
  • The username must match the format used when the user was registered in Cognito

Password Requirements:

  • Must meet Cognito password policy requirements
  • Typically: 8-30 characters, mix of uppercase, lowercase, and numbers

Verification Code:

  • Must be the 6-digit code received via email from Cognito
  • If code is invalid or expired, returns 400 Bad Request with error message

Important:

  • Both Cognito and legacy DB passwords should be updated together
  • If Cognito update fails, the calling service should NOT update the legacy database password
  • User must request a new password reset code if verification fails

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)
Authorizations:
ClientAccessToken
header Parameters
Content-Type
required
string

application/json

Access-Token
required
string

Access token from Cognito OAuth2 for Client

Request Body schema: application/json
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

Responses

Request samples

Content type
application/json
{
  • "username": "members_api.12345",
  • "code": "123456",
  • "password": "NewPassword123!"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Password reset successful",
  • "data": null
}

Change email address in Cognito

Change user's email address in AWS Cognito. This endpoint initiates the email change process by updating the email attribute in Cognito.

Flow Overview:

  1. Validates Cognito access token from Authorization header
  2. Calls AWS Cognito UpdateUserAttributes API to update email attribute
  3. Cognito automatically generates and sends a 6-digit verification code to the new email address
  4. Sets email_verified = false until user verifies the code

Important Notes:

  • The email in Cognito is changed to the new email immediately, but email_verified = false
  • User must verify the email using the verification code sent to the new email address
  • The verification code is typically 6 digits and expires after 3-5 minutes
  • User must call /email/verify endpoint to complete the email change process
  • Legacy database should be updated by the calling service after successful verification

Prerequisites:

  • User must be logged in with Cognito authentication (valid access token required)
  • User must have migrated to Cognito (have a record in mfa_users table)
  • New email address must not be used by any other accounts
Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Request Body schema: application/json
new_email
required
string <email> <= 255 characters

New email address to change to

Responses

Request samples

Content type
application/json
{
  • "new_email": "newemail@example.com"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Verification code has been sent to your new email address",
  • "data": { }
}

Get email verification status

Retrieve the current email address and verification status from Cognito for the authenticated user.

Flow Overview:

  1. Validates Cognito access token from Authorization header
  2. Calls AWS Cognito GetUser API to retrieve user attributes
  3. Returns email address and email_verified status

Use Cases:

  • Check if email has been verified after change request
  • Display current email address and verification status to user
  • Determine if user needs to verify email before proceeding

Prerequisites:

  • User must be logged in with Cognito authentication (valid access token required)
Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Verify email address with code

Verify the email address change by submitting the verification code sent to the new email address.

Flow Overview:

  1. Validates Cognito access token from Authorization header
  2. Calls AWS Cognito VerifyUserAttribute API to verify the code
  3. If code is valid, Cognito sets email_verified = true

Important Notes:

  • The verification code is a 6-digit code sent to the new email address
  • The code typically expires after 3-5 minutes
  • If code is invalid or expired, user can request a new code via /email/resend-verification
  • After successful verification, the calling service should update the legacy database (auth_user.email and auth_user.username)
  • Legacy database update is handled by the calling service, not auth-api

Prerequisites:

  • User must be logged in with Cognito authentication (valid access token required)
  • User must have requested email change via /email/change endpoint
  • User must have received verification code via email
Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Request Body schema: application/json
verification_code
required
string = 6 characters ^[0-9]{6}$

6-digit verification code received via email from Cognito

Responses

Request samples

Content type
application/json
{
  • "verification_code": "123456"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Email address verified successfully",
  • "data": { }
}

Resend email verification code

Resend the verification code to the current email address in Cognito.

Flow Overview:

  1. Validates Cognito access token from Authorization header
  2. Calls AWS Cognito GetUserAttributeVerificationCode API
  3. Cognito generates and sends a new 6-digit verification code to the email address

Important Notes:

  • This endpoint sends a new verification code to the email address currently set in Cognito
  • The new code replaces any previously sent code
  • The code is typically 6 digits and expires after 3-5 minutes
  • User should check email spam folder if code is not received

Prerequisites:

  • User must be logged in with Cognito authentication (valid access token required)
  • User must have requested email change via /email/change endpoint
  • Email must not be already verified (should be checked by the calling service before calling this endpoint)
Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Verification code has been resent. Please check your email.",
  • "data": { }
}

Token Management

Token verification and refresh operations

Verify access token

Verify the validity of the current access token.

Flow Overview:

  1. Validates Cognito access token from Authorization header
  2. Returns success if token is valid

Prerequisites:

  • User must be logged in with Cognito authentication (valid access token required)
Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Token verification successful",
  • "data": { }
}

Refresh access token

Refresh the access token using a refresh token to obtain new authentication tokens.

Flow Overview:

  1. Verifies client token (Access-Token)
  2. Calls AWS Cognito InitiateAuth with REFRESH_TOKEN_AUTH flow
  3. Returns new access token, ID token, and token metadata
  4. login_method and session_access_state are inherited from the previous login session

Prerequisites:

  • Valid refresh token from previous authentication
  • Client token (Access-Token) must be valid
Authorizations:
ClientAccessToken
header Parameters
Content-Type
required
string

application/json

Access-Token
required
string

Access token from Cognito OAuth2 for Client

Request Body schema: application/json
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

Responses

Request samples

Content type
application/json
{
  • "username": "members_api.12345",
  • "refresh_token": "eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIn0..."
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Token refreshed successfully",
  • "data": {
    }
}

User Registration

User registration in Cognito and MFA user management

Register new user in Cognito and create MFA user

Register a new user in AWS Cognito and create MFA user record.

Flow Overview:

  1. Verifies client token (Access-Token)
  2. Calls AWS Cognito SignUp API with:
    • username (provided by the calling service)
    • password = user's password
    • email attribute set to user's email
    • custom:external_user_id custom attribute set to user's external_user_id
  3. Cognito triggers Pre-SignUp Lambda which:
    • Sets AutoConfirmUser = true (user is immediately confirmed)
    • Sets AutoVerifyEmail = true (email is automatically verified)
  4. Creates mfa_users record in New DB with:
    • client_id (resolved from verified Access-Token)
    • external_user_id
    • cognito_sub (from Cognito UserSub)
    • cognito_username (the username used in Cognito)
    • twofa_enabled = TRUE (2FA is enabled for new users, requiring setup on first login)
    • twofa_method = NULL (2FA method is not yet configured, user needs to set up 2FA method)

2FA Settings for New Users:

  • New users are registered with twofa_enabled = TRUE and twofa_method = NULL
  • This ensures that when users first log in, they will have session_access_state = 'restricted_access' and must set up a 2FA method (phone or passkey) to gain full access
  • User can configure their preferred 2FA method after first login

Username Format:

  • Username format is determined by the calling service
  • The username must be unique within the Cognito User Pool
  • The username is provided in the request body by the calling service
  • Example: members_api.12345

Password Requirements:

  • Must meet Cognito password policy requirements
  • Typically: 8-30 characters, mix of uppercase, lowercase, and numbers

On success, the user is confirmed in Cognito and ready for subsequent authentication and MFA flows.

Authorizations:
ClientAccessToken
header Parameters
Content-Type
required
string

application/json

Access-Token
required
string

Access token from Cognito OAuth2 for Client

Request Body schema: application/json
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

Responses

Request samples

Content type
application/json
{
  • "external_user_id": "12345",
  • "username": "members_api.12345",
  • "email": "user@example.com",
  • "password": "SecurePassword123!"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "User registered successfully",
  • "data": null
}

User Switch Account

Switching between linked user accounts

Switch to linked account

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:

  1. Validates access token (middleware) - signature, expiration, issuer to identify the user
  2. Validates request format and required fields
  3. Checks if User B exists in the new system database (mfa_users)
  4. If User B does not exist, performs automatic migration:
    • Generates a random temporary password
    • Creates User B in AWS Cognito using AdminCreateUser with:
      • email_verified = true
      • custom:external_user_id = target_external_user_id
      • MessageAction = SUPPRESS
    • User is created in FORCE_CHANGE_PASSWORD state (AdminCreateUser bypasses PreSignUp Lambda)
    • User is created with custom:external_user_id attribute set
    • Gets cognito_sub using AdminGetUser API
    • Creates mfa_users record with cognito_sub already set
  5. Initiates AWS Cognito CUSTOM_AUTH flow with:
    • USERNAME = target_username (cognito username)
    • ClientMetadata: {target_id, current_id} (both are members.id from Legacy DB)
  6. Cognito triggers Lambda functions:
    • DefineAuthChallenge: defines CUSTOM_CHALLENGE
    • CreateAuthChallenge: sets challenge parameters with target_id and current_id
    • VerifyAuthChallengeResponse: validates linkages in Legacy DB using target_id and current_id
  7. Upon successful linkage validation, Cognito issues tokens for User B
  8. Extracts sub (cognito_sub) from User A's AccessToken (from Authorization header, already validated in middleware)
  9. Queries mfa_users table using cognito_sub = sub to find User A's mfa_users.id
  10. Updates User B's record in mfa_users table:
    • Sets switched_by_id = User A's mfa_users.id
    • Sets session_access_state = 'full_access' (2FA is bypassed for switch-user)
  11. Updates mfa_users.client_id if NULL
  12. Returns tokens for User B with session_access_state = 'full_access'

Important Notes:

  • This endpoint is called by liaison-platform (not directly by members-api)
  • liaison-platform is responsible for:
    • Authenticating User A (via Authorization header with Bearer token)
    • Calling members-api first to validate A ↔ B relationship in legacy DB (member_linkages table)
    • Receiving prepared User B information from members-api (current_id, target_id, target_username, target_email, target_external_user_id)
  • Auth API middleware validates access token from Authorization header to identify User A (signature, expiration, issuer)
  • Lambda functions validate linkages in Legacy DB (member_linkages table) using target_id and current_id (both are members.id)
  • If User B does not exist, automatic migration is performed using provided data (Auth API cannot connect to Legacy DB)

Username Format:

  • Username format: members_api.{external_user_id}
  • Example: members_api.12345

Automatic Migration:

  • If User B does not exist in Cognito, Auth API creates the user using:
    • target_username (cognito username)
    • target_email (email address)
    • target_external_user_id (external user identifier)
  • User is created with email_verified = true, custom:external_user_id = target_external_user_id, and in FORCE_CHANGE_PASSWORD state
  • mfa_users record is created with cognito_sub already set

Session Access State:

  • full_access: User has full access immediately (2FA is bypassed for switch-user)
    • Switch-user bypasses 2FA verification when switched_by_id is set
    • User B's session_access_state is always set to 'full_access' after successful switch, regardless of 2FA settings
    • This allows User A (who is already authenticated) to seamlessly switch to User B without additional verification

Login Method:

  • switch_user: Account switching between linked accounts
Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Request Body schema: application/json
current_id
required
integer

members.id of User A (current user) from Legacy DB. This ID is used by Lambda to query member_linkages table for linkage validation.

target_id
required
integer

members.id of User B (target user) from Legacy DB. This ID is used by Lambda to query member_linkages table for linkage validation.

target_username
required
string <= 255 characters

Cognito username for User B in format members_api.{external_user_id}. This username is prepared by members-api before calling this endpoint.

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 member_externals table before calling this endpoint.

Responses

Request samples

Content type
application/json
{
  • "current_id": 12345678,
  • "target_id": 87654321,
  • "target_username": "members_api.12345",
  • "target_email": "userb@example.com",
  • "target_external_user_id": "12345"
}

Response samples

Content type
application/json

Response for successful account switch. 2FA is bypassed and user gets full access immediately.

{
  • "success": true,
  • "message": "Account switched successfully",
  • "data": {
    }
}

MFA Settings

User authentication method configuration and preferences

Get authentication settings

Retrieve current authentication method configuration for the logged-in user. Returns password status, 2FA settings, phone verification status, and passkey count.

Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Update authentication settings

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:

  1. User who is logged in with password authentication wants to update MFA settings
  2. User provides current password for identity verification
  3. User provides new MFA settings configuration in the request body
  4. System verifies the password and, if successful, updates the MFA settings with the provided configuration

Identity Verification:

  • User must re-authenticate using password even though they are already logged in
  • This ensures that only the authenticated user can modify their security settings
  • Password is required in the request body for verification

MFA Settings Options (for users logged in with password):

  • User can enable 2FA with method phone (phone call 2FA for password login)
  • User can enable 2FA with method passkey (switch to passkey authentication)

MFA Settings Format:

  • twofa_enabled: Boolean to enable/disable 2FA
  • twofa_method: String enum (phone or passkey) to specify the 2FA method

Note: 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_settings
  • When twofa_method is phone: 2FA (Caller ID) requires verified phone number
  • When twofa_method is passkey: User must have at least one registered passkey device
  • Settings are only updated if password verification succeeds
Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Request Body schema: 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.

Responses

Request samples

Content type
application/json
Example

User enables password authentication with phone call 2FA after password verification

{
  • "password": "user_password",
  • "mfa_settings": {
    }
}

Response samples

Content type
application/json
Example

Response when user successfully enables passkey authentication

{
  • "success": true,
  • "message": "Your authentication settings have been updated successfully",
  • "data": {
    }
}

Get phone-based 2FA settings

Retrieve detailed information about phone-based 2FA settings (phone number, country code, and verification timestamp) for the authenticated user

Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Phone Call 2FA

Phone call-based two-factor authentication

Register phone number

Initiate phone number registration for new users

Authorizations:
BearerAuth
header Parameters
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

Request Body schema: application/json
phone_number
required
string

Phone number to register

phone_country_code
required
string

Country code (e.g., +81)

Responses

Request samples

Content type
application/json
{
  • "phone_number": "string",
  • "phone_country_code": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Get phone call status

Retrieve status of phone verification process.

Authorizations:
BearerAuth
query Parameters
phone_system_session_id
required
string <uuid>

Session ID from phone system

header Parameters
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

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Start phone call verification

Initiate phone call verification for 2FA

Authorizations:
BearerAuth
header Parameters
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

Request Body schema: application/json
context_type
required
string

Context for phone verification (e.g., 'payment', 'login', 'fund_confirmation', 'deposit')

Responses

Request samples

Content type
application/json
{
  • "context_type": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Start Phone Call 2FA Update

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:

  1. Re-authenticate using their password to verify their identity
  2. Complete phone call verification to confirm the change

Flow Overview:

  1. User who is logged in with password + 2FA phone call wants to update MFA settings
  2. User provides current password for identity verification
  3. System verifies the password
  4. If password verification succeeds, system calls Phone System to initiate phone call verification
  5. System returns phone call verification information (dedicated phone number, session ID, etc.)
  6. User receives phone call and verifies via Phone System
  7. User checks verification status via /call/status endpoint
  8. After successful verification, user calls /call/update-mfa-settings/finish to complete the MFA settings update

Identity Verification:

  • User must re-authenticate using password even though they are already logged in
  • This ensures that only the authenticated user can modify their security settings
  • Password verification is required before initiating phone call verification

Prerequisites:

  • User must be currently logged in with password + 2FA phone call authentication (valid access token required)
  • User must have a verified phone number registered
Authorizations:
BearerAuth
header Parameters
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

Request Body schema: application/json
password
required
string <password>

Current user password for identity verification

Responses

Request samples

Content type
application/json

User provides password to initiate phone call verification for MFA settings update

{
  • "password": "user_password"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Finish Phone Call 2FA Update

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:

  1. User has completed phone call verification (verified via /call/status endpoint)
  2. User calls this endpoint with the new MFA settings configuration
  3. System validates the settings and updates the MFA configuration
  4. System returns the updated MFA settings

MFA Settings Options (for users logged in with password + 2FA phone call):

  • User can switch to passkey authentication (twofa_enabled: true, twofa_method: "passkey")
  • Important: Once 2FA is enabled, it cannot be disabled (security requirement)
  • User cannot set 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 authentication

Validation rules:

  • twofa_enabled and twofa_method are required in mfa_settings
  • twofa_enabled must be true (cannot disable 2FA once enabled)
  • Settings are only updated if phone call verification was successful
Authorizations:
BearerAuth
header Parameters
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

Request Body schema: application/json
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.

Responses

Request samples

Content type
application/json

User switches from password + 2FA phone call to passkey authentication

{
  • "mfa_settings": {
    }
}

Response samples

Content type
application/json

Response when user successfully switches from password + 2FA phone call to passkey authentication

{
  • "success": true,
  • "message": "Your authentication settings have been updated successfully",
  • "data": {
    }
}

Change phone number

Initiate phone number change process.

Authorizations:
BearerAuth
header Parameters
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

Request Body schema: application/json
new_phone_number
required
string
phone_country_code
required
string

Responses

Request samples

Content type
application/json
{
  • "new_phone_number": "string",
  • "phone_country_code": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Cancel phone call verification

Cancel ongoing phone verification process

Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Request Body schema: application/json
phone_system_session_id
required
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "phone_system_session_id": "e995910b-651e-4a22-963b-eb57323fa74d"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": { }
}

Recovery

Account recovery and login recovery flows (e.g., phone call recovery)

Verify external ID and initiate recovery

Verify external ID and initiate recovery process.

Flow:

  1. Verifies the username and password is valid.
  2. Initiates recovery session.
Authorizations:
ClientAccessToken
header Parameters
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

Request Body schema: application/json
username
required
string <= 255 characters

User's username in format members_api.{external_user_id}. Example: members_api.12345

password
string <password> <= 255 characters

User's password

Responses

Request samples

Content type
application/json
{
  • "username": "members_api.12345",
  • "password": "UserPassword123!"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Recovery verification successful",
  • "data": {
    }
}

Start account recovery

Initiate phone verification for account recovery (e.g., lost passkey)

Authorizations:
ClientAccessToken
header Parameters
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

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Get account recovery phone call status

Retrieve status of phone verification process during account recovery (login recovery).

Authorizations:
ClientAccessToken
query Parameters
phone_system_session_id
required
string <uuid>

Session ID from phone system used for recovery

header Parameters
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

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Cancel account recovery phone call

Cancel ongoing phone verification process during account recovery (login recovery).

Authorizations:
ClientAccessToken
header Parameters
Content-Type
required
string

application/json

Access-Token
required
string

Access token from Cognito OAuth2 for Client

Request Body schema: application/json
phone_system_session_id
required
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "phone_system_session_id": "e995910b-651e-4a22-963b-eb57323fa74d"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": { }
}

Passkey

Passkey (WebAuthn) authentication and management

Start passkey verification

Initialize passkey verification for authenticated users. Always returns a WebAuthn challenge response.

Authorizations:
BearerAuth
header Parameters
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

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Passkey verification initialized successfully",
  • "data": {
    }
}

Complete passkey verification

Finish passkey verification and receive auth code

Authorizations:
BearerAuth
header Parameters
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

Request Body schema: application/json
session_id
required
string

Session token from Cognito

challenge_name
required
string
Value: "WEB_AUTHN"

Challenge name (should be 'WEB_AUTHN')

required
object

Responses

Request samples

Content type
application/json
{
  • "session_id": "AQECAHjv...long-session-string-from-cognito",
  • "challenge_name": "WEB_AUTHN",
  • "challenge_response": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Passkey verified successfully",
  • "data": {
    }
}

Start Passkey 2FA Update

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:

  1. User calls this endpoint to initiate the passkey re-authentication challenge
  2. System returns a WebAuthn challenge that the user must complete
  3. User completes passkey authentication via /passkey/update-mfa-settings/finish endpoint
  4. If verification succeeds, MFA settings are updated with the provided configuration

Prerequisites:

  • User must be currently logged in with passkey authentication (valid access token required)
  • User must have at least one registered passkey device

Response:

  • Always returns a WebAuthn challenge response that can be used with the browser's WebAuthn API
  • The challenge must be completed within the session timeout period
Authorizations:
BearerAuth
header Parameters
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

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Passkey verification initialized successfully",
  • "data": {
    }
}

Finish Passkey 2FA Update

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:

  1. User initiates MFA settings update via /passkey/update-mfa-settings/start to get a WebAuthn challenge
  2. User completes passkey authentication (WebAuthn challenge response)
  3. This endpoint verifies the passkey signature and, if successful, updates the MFA settings with the provided mfa_settings configuration

Identity Verification:

  • User must re-authenticate using passkey even though they are already logged in
  • This ensures that only the authenticated user can modify their security settings

MFA Settings Update:

  • The mfa_settings object contains the new configuration that will be applied after successful passkey verification
  • Settings are only updated if passkey verification succeeds

MFA Settings Options (for users logged in with passkey):

  • User can switch to only password authentication (twofa_enabled: false, twofa_method: null)
  • User can enable password authentication with phone call 2FA (twofa_enabled: true, twofa_method: "phone")

MFA Settings Format:

  • twofa_enabled: Boolean to enable/disable 2FA
  • twofa_method: String enum (phone or null) to specify the 2FA method. Set to null when disabling 2FA (switching to only password)
Authorizations:
BearerAuth
header Parameters
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

Request Body schema: application/json
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.

Responses

Request samples

Content type
application/json
Example

User switches from passkey to only password authentication (no 2FA)

{
  • "session_id": "AQECAHjv...long-session-string-from-cognito",
  • "challenge_response": {
    },
  • "mfa_settings": {
    }
}

Response samples

Content type
application/json
Example

Response when user successfully switches from passkey to only password authentication (no 2FA)

{
  • "success": true,
  • "message": "Your authentication settings have been updated successfully",
  • "data": {
    }
}

Get passkey list

Retrieve list of all registered passkey devices for the authenticated user. Returns device name, creation date, and last used timestamp for each passkey.

Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Passkey list retrieved successfully",
  • "data": {
    }
}

Rename passkey device

Update the display name of a registered passkey device. User can only rename their own passkeys.

Validation rules:

  • Device name cannot be empty
  • Maximum length: 255 characters
  • Must be the passkey owner
Authorizations:
BearerAuth
path Parameters
id
required
integer >= 1

Passkey device ID to rename

header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Request Body schema: application/json
device_name
required
string [ 1 .. 255 ] characters

New display name for the passkey device

Responses

Request samples

Content type
application/json
{
  • "device_name": "Home MacBook Pro"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Passkey name has been saved",
  • "data": {
    }
}

Start passkey registration

Initialize passkey registration with WebAuthn challenge from Cognito

Authorizations:
BearerAuth
header Parameters
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

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Complete passkey registration

Finish passkey registration with WebAuthn credential

Authorizations:
BearerAuth
header Parameters
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

Request Body schema: application/json
session_id
required
string <uuid> <= 255 characters

Session ID from registration start

required
object (WebAuthnRegistrationCredential)

Responses

Request samples

Content type
application/json
{
  • "session_id": "1ffd059c-17ea-40a8-8aef-70fd0307db82",
  • "credential": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Passkey registered successfully",
  • "data": {
    }
}

Cancel passkey challenge

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:

  • For registration: This endpoint is called when the user actively cancels the registration flow, not when they skip the naming step after successful registration.
  • For adding passkey: This endpoint is called when the user cancels the passkey addition flow.
  • For deleting passkey: This endpoint is called when the user cancels the passkey deletion flow.
  • For login cancellation, use /passkey/login/cancel endpoint instead.

Authentication:

  • This endpoint requires Bearer Token authentication (Authorization header with Bearer token)
  • User must be logged in with Cognito authentication

Prerequisites:

  • User must be logged in with Cognito authentication (valid Bearer token required)
Authorizations:
BearerAuth
header Parameters
Authorization
required
string

Bearer Cognito AccessToken authentication token (format: Bearer {token})

Content-Type
required
string

application/json

Request Body schema: application/json
session_id
required
string <uuid>

Session ID from passkey registration start

Responses

Request samples

Content type
application/json
{
  • "session_id": "550e8400-e29b-41d4-a716-446655440000"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Passkey challenge cancelled successfully",
  • "data": {
    }
}

Start passkey login

Initialize passkey login and generate WebAuthn challenge.

Flow Overview:

  1. Verifies client token (Access-Token)
  2. Queries mfa_users to verify user has passkey authentication enabled (twofa_enabled=TRUE, twofa_method='passkey')
  3. Queries passkey_devices to get list of registered passkey credential IDs
  4. Calls AWS Cognito InitiateAuth with PREFERRED_CHALLENGE: WEB_AUTHN to generate WebAuthn challenge
  5. Stores challenge in passkey_challenges table
  6. Returns challenge data and list of credential IDs to client

Prerequisites:

  • User validation (user existence, account lock status, member status) must be completed by members-api via POST /members/login before calling this endpoint
  • User must have passkey authentication enabled (twofa_enabled=TRUE, twofa_method='passkey')
  • User must have at least one registered passkey device

Error Responses:

  • 401 INVALID_CREDENTIALS: User not found in mfa_users or member disabled/restricted
  • 401 NO_PASSKEY_DEVICES: No passkey devices found for this user
  • 401 INVALID_CLIENT_TOKEN: Access-Token header is missing, invalid, or expired
Authorizations:
ClientAccessToken
header Parameters
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

Request Body schema: application/json

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.

Responses

Request samples

Content type
application/json
{
  • "username": "members_api.123456"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Complete passkey login

Verify WebAuthn assertion and complete passkey login to receive Cognito tokens.

Flow Overview:

  1. Verifies client token (Access-Token)
  2. Validates the WebAuthn challenge (session_id, not expired, not used)
  3. Verifies passkey device exists and matches the credential ID
  4. Calls Cognito RespondToAuthChallenge to verify the signature
  5. Upon successful verification, Cognito returns authentication tokens
  6. Updates mfa_users.session_access_state = 'full_access' (passkey authentication provides full 2FA verification)
  7. Updates passkey device last_used_at timestamp
  8. Logs authentication event
  9. After successful login, the calling service (liaison-platform) is responsible for updating login records (last_login, login_logs, login_lists reset)

Session Access State:

  • full_access: Always set for passkey login
    • Passkey authentication inherently provides full 2FA verification
    • User has full access immediately after successful passkey authentication
    • No additional verification steps required

Login Method:

  • passkey: Passkey (WebAuthn) authentication
Authorizations:
ClientAccessToken
header Parameters
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

Request Body schema: application/json

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

Responses

Request samples

Content type
application/json
{
  • "session_id": "string",
  • "challenge_name": "WEB_AUTHN",
  • "challenge_response": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Cancel passkey login challenge

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:

  • This endpoint requires Client Access Token authentication (Access-Token header)
  • User does not need to be logged in (this is part of the login flow)

Flow Overview:

  1. Verifies client token (Access-Token)
  2. Marks the challenge as used (used_at = NOW) to prevent replay attacks
  3. Logs authentication event with result='cancelled' and context_type='passkey_login'

Prerequisites:

  • User must have initiated passkey login via /passkey/login/start endpoint
  • Challenge session must exist and not be expired
Authorizations:
ClientAccessToken
header Parameters
Content-Type
required
string

application/json

Access-Token
required
string

Access token from Cognito OAuth2 for Client

Request Body schema: application/json
session_id
required
string <uuid>

Session ID from passkey login start

Responses

Request samples

Content type
application/json
{
  • "session_id": "550e8400-e29b-41d4-a716-446655440000"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Passkey login challenge cancelled successfully",
  • "data": {
    }
}

Start passkey deletion

Initialize passkey deletion with 2FA verification

Authorizations:
BearerAuth
path Parameters
id
required
integer >= 1

Passkey device ID to delete

header Parameters
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

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Complete passkey deletion

Finish passkey deletion with WebAuthn verification

Authorizations:
BearerAuth
path Parameters
id
required
integer >= 1

Passkey device ID to delete

header Parameters
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

Request Body schema: application/json
session_id
required
string <= 500 characters
challenge_name
required
string <= 50 characters
Value: "WEB_AUTHN"
required
object

Responses

Request samples

Content type
application/json
{
  • "session_id": "string",
  • "challenge_name": "WEB_AUTHN",
  • "challenge_response": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Admin - User Management

Administrative operations for managing user security settings

List MFA users

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:

  • List of users with MFA status
  • Registered authentication methods (passkey, phone, etc.)
Authorizations:
ClientAccessToken
query Parameters
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)

header Parameters
Access-Token
required
string

Access token from Cognito OAuth2 for Client

Content-Type
required
string

application/json

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "MFA user list retrieved successfully",
  • "data": [
    ],
  • "meta": {
    },
  • "links": {
    }
}

Get user security settings

Retrieve user's security settings for admin view. Returns current 2FA status, authentication methods, and passkey devices.

Required permissions: Security Admin role

Returns:

  • 2FA enabled/disabled status
  • Active 2FA method (passkey/phone/none)
  • Phone number (masked for security)
  • List of registered passkey devices
  • Phone verification status
Authorizations:
ClientAccessToken
path Parameters
mfa_user_id
required
string
Example: 22

External user identifier from the calling service

header Parameters
Access-Token
required
string

Access token from Cognito OAuth2 for Client

Content-Type
required
string

application/json

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Update user security settings

Update user's security settings (admin only).

Required permissions: Security Admin role

Supported operations:

  • Enable/disable 2FA
  • Change 2FA method (passkey/phone)
Authorizations:
ClientAccessToken
path Parameters
mfa_user_id
required
string
Example: 22

External user identifier from the calling service

header Parameters
Access-Token
required
string

Access token from Cognito OAuth2 for Client

Content-Type
required
string

application/json

Request Body schema: application/json
twofa_enabled
boolean

Enable or disable 2FA

twofa_method
string
Enum: "passkey" "phone"

Set 2FA method

Responses

Request samples

Content type
application/json
{
  • "twofa_enabled": true,
  • "twofa_method": "passkey"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Settings updated successfully",
  • "data": { }
}

Change user's phone number

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.

Authorizations:
ClientAccessToken
path Parameters
mfa_user_id
required
string
Example: 22

MFA user ID (external_user_id)

header Parameters
Access-Token
required
string

Access token from Cognito OAuth2 for Client

Content-Type
required
string

application/json

Request Body schema: application/json
phone_number
required
string

New phone number to set

phone_country_code
required
string

Country code (e.g., +81)

Responses

Request samples

Content type
application/json
{
  • "phone_number": "09012345678",
  • "phone_country_code": "+81"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Phone number updated successfully",
  • "data": { }
}

Delete user's phone number

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.

Authorizations:
ClientAccessToken
path Parameters
mfa_user_id
required
string
Example: 22

MFA user ID (external_user_id)

header Parameters
Access-Token
required
string

Access token from Cognito OAuth2 for Client

Content-Type
required
string

application/json

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Phone number deleted successfully",
  • "data": { }
}

Delete user's passkeys

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.

Authorizations:
ClientAccessToken
path Parameters
mfa_user_id
required
string
Example: 22

MFA user ID (external_user_id)

passkey_id
required
string
Example: 121

Passkey device ID

header Parameters
Access-Token
required
string

Access token from Cognito OAuth2 for Client

Content-Type
required
string

application/json

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Passkeys deleted successfully",
  • "data": { }
}

Webhook

Webhook endpoints for external integrations

Phone call verification webhook

Webhook endpoint for phone call verification status updates

Request Body schema: application/json
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

Responses

Request samples

Content type
application/json
{
  • "transaction_id": "99be3bdc-8b13-4d51-b642-2b9230f839d2",
  • "status": "succeeded",
  • "authentic_number": "+81234567890",
  • "customer_number": "+81234567890",
  • "identifier": "optional-identifier-123"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Webhook processed successfully",
  • "data": [ ]
}