Create and send MFA verification code

POST /api/experience/verification/mfa-verification-code

Create a new MFA verification code and send it to the user's bound identifier (email or phone). This endpoint automatically uses the user's bound email address or phone number from their profile for MFA verification. The user must be identified before calling this endpoint.

application/json

Body Required

  • identifierType string Required

    The type of identifier to use for MFA verification. Must be either 'Email' or 'Phone'. The endpoint will automatically use the user's bound identifier of this type.

    Values are email, phone, Email, or Phone.

Responses

  • 200 application/json

    The MFA verification code has been successfully sent to the user's bound identifier.

    Hide response attribute Show response attribute object
    • verificationId string Required

      The unique ID of the verification record. Required to verify the code.

  • 400

    Bad request. The user is not identified or does not have the specified identifier type bound for MFA.

  • 404

    User not found.

  • 501

    The connector for the specified identifier type is not configured.

POST /api/experience/verification/mfa-verification-code
curl \
 --request POST 'https://[tenant_id].logto.app/api/experience/verification/mfa-verification-code' \
 --header "Content-Type: application/json" \
 --data '{"identifierType":"email"}'
Request examples
{
  "identifierType": "email"
}
Response examples (200)
{
  "verificationId": "string"
}