How to generate multiple recovery codes with the /mfa/associate API?

I am using /mfa/associate API to enroll for otp based 2fa.
The response includes a recovery_codes array, but it currently only provides a single recovery code.
Is there any way to generate multiple codes?

Here’s the relevant part of my request:

$response = Http::withHeaders([
    'Authorization' => 'Bearer ' . $request->mfa_token,
    'Content-Type' => 'application/json',
])->post('https:// { MY_DOMAIN } /mfa/associate', [
    'authenticator_types' => ['otp'],
]);

My Question is essentially the same as this one.
However, after a period of inactivity, it was closed with only a wide of the mark answer.

Any insights or guidance on this would be greatly appreciated.
Thank you.

Hi @t.fukao, and thank you for your question, which can help clarify this issue.

It is not possible to generate multiple recovery codes for the user at the same time. As my colleague pointed out in the topic you linked, only one recovery code can be active at a time. The initial code is generated upon enrollment, and afterwards, a code to replace the initial one can be generated with a call to the Management API.

I understand that the property name recovery_codes is misleading, and perhaps the team would like to implement this feature later. It would be a great idea to share your use case with the team in the feature-request section.

Thank you, and let me know if there is more I can help you with!
Teodor.