Administrators often need to enroll and activate different Okta factors programmatically. Okta provides specific API endpoints and JSON payloads to enroll and auto-activate factors such as email, SMS, voice call, and security questions for a user.
- Okta Identity Engine (OIE)
- Okta Classic Engine
- API
- Multi-Factor Authentication (MFA)
- Factor Enrollment
What are the steps to enroll and activate Okta factors via API?
To enroll and auto-activate a factor for a user, execute a POST request to the factors API endpoint using the appropriate JSON body for the desired factor type.
https://<OktaDomainName>/api/v1/users/<userId>/factors?activate=true
The same API endpoint processes the request, but the JSON body differs based on the specific factor. For a comprehensive list of available factors and the necessary JSON body for each, refer to Enroll a factor.
Below is a JSON example for the Email factor and a screenshot of a populated request body.
{
"factorType": "email",
"provider": "OKTA",
"profile": {
"email": "test@email.com "
}
}
Related References
