Okta Factors API - Enroll Factor fails due to HTTP 400 Invalid Profile Error

I’m enrolling SMS Factors using the Okta Python SDK and sometimes seeing the following error:

Okta HTTP 400 E0000001 Api validation failed: factorEnrollRequest\nInvalid Profile.

Here’s some of my code that is hopefully relevant:

    sms_factor = models.SmsUserFactor({
        'profile': models.SmsUserFactorProfile({
            'phoneNumber': phone_number
        })
    })
    asyncio.run(client.enroll_factor(userId=okta_id, user_factor=sms_factor, query_params={'activate': 'true'}))

What are the potential causes of this? For that same customer, 5 minutes earlier I’m seeing an failure due to Invalid Phone. Is Invalid Profile actually just another Invalid Phone error?

Did you check the format of a phone number where this error was thrown? I’ve definitely seen Invalid Phone failures before, not Invalid Profile, but thats the only thing included in the profile when enrolling an SMS factor, so not sure what else it would be.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.