Reset password using passcode sent via email

I have integrated Android classic SDK for embedded Okta authentication. There is a requirement to recover passwords only with passcode either via email or SMS. As per the requirement, we can’t use the reset password link sent in an email.

I have used the following API from AuthenticationClient class to initiate password recovery.

@ApiReference(path = “/api/v1/authn/recovery/password”, href = “Authentication | Okta Developer”)

AuthenticationResponse recoverPassword(String username, FactorType factorType, String relayState, AuthenticationStateHandler stateHandler) throws AuthenticationException;

Dependency version: com.okta.authn.sdk:okta-authn-sdk-api:2.0.0

However, the success response of this API with email factor type always sends a reset password link in an email without any passcode. SMS and Email authenticators are already enrolled for the test account used for authentication.

Is it possible to get the passcode via email using recoverPassword API? If not, which API should be used for this purpose?

Any help would be greatly appreciated.