Create Staged user(s) using Python SDK

I’m trying to use Okta’s SDK for Python when creating a new user from an Excel sheet I go through.
After reading all of the user’s fields from Excel, I want to add the user in the Staged user status. That being said, going through the SDK’s source code it seems like the current function of models.CreateUserRequest does not contain the activate field.

async def create_user(user_info):
    # Create User Profile and CreateUser Request
    user_profile = models.UserProfile()
    user_profile.first_name = user_info.first_name
    user_profile.last_name  = user_info.last_name
    user_profile.email      = user_info.email
    user_profile.login      = user_info.login

    create_user_req = models.CreateUserRequest({
        'activate': False,
        'profile': user_profile,
    })

    # Create User
    user, resp, err = await client.create_user(create_user_req)
    response_body = resp.get_body()
    [...]

Is there a possible way to achieve that?

Just found a solution to this problem in the integration test section.

Full answer:

    create_user_req = models.CreateUserRequest({
        'profile': user_profile,
    })

    query_params_create = {"activate": "False"}

    # Create User
    user, resp, err = await client.create_user(create_user_req, query_params_create)

Is there official documentation for this?

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