Create User through API that Will Target a Password Policy that is Applied to a Specific Group
Last Updated:
Overview
This knowledge article discusses how to create users through the Okta API with a specific password based on a group applied password policy.
Applies To
- Okta Classic Engine
- Okta Identity Engine (OIE)
- API
- Users
- Groups
- Password policies
Cause
In order to create users through the Okta API with a specific password based on a group applied password policy, the group information must be included in API call body.
Solution
A user can be created with a password that meets the requirements of a password policy assigned to a specific Okta group.
To achieve this, the following API call can be used: {url}/api/v1/users?activate=true with the following body:
{"profile": {"firstName": "test","lastName": "test","email": "test@test.com","login": "test@test.com"},"credentials": {"password" : { "value": "example" }},"groupIds": ["<GROUP_ID_FROM_PASSWORD_POLICY>"]}
Related References
