Class UserLifecycleApi

java.lang.Object
com.okta.sdk.resource.api.UserLifecycleApi

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2026-03-13T17:36:05.533634+05:30[Asia/Kolkata]", comments="Generator version: 7.15.0") public class UserLifecycleApi extends Object
  • Constructor Details

    • UserLifecycleApi

      public UserLifecycleApi()
    • UserLifecycleApi

      public UserLifecycleApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • activateUser

      public UserActivationToken activateUser(String id, Boolean sendEmail) throws ApiException
      Activate a user Activates a user. Perform this operation only on users with a `STAGED` or `DEPROVISIONED` status. Activation of a user is an asynchronous operation. * The user has the `transitioningToStatus` property with an `ACTIVE` value during activation. This indicates that the user hasn't completed the asynchronous operation. * The user has an `ACTIVE` status when the activation process completes. Users who don't have a password must complete the welcome flow by visiting the activation link to complete the transition to `ACTIVE` status. > **Note:** If you want to send a branded user activation email, change the subdomain of your request to the custom domain that's associated with the brand. > For example, change `subdomain.okta.com` to `custom.domain.one`. See [Multibrand and custom domains](https://developer.okta.com/docs/concepts/brands/#multibrand-and-custom-domains). > **Note:** If you have optional password enabled, visiting the activation link is optional for users who aren't required to enroll a password. > See [Create user with optional password](/openapi/okta-management/management/tag/User/#create-user-with-optional-password). > **Legal disclaimer** > After a user is added to the Okta directory, they receive an activation email. As part of signing up for this service, > you agreed not to use Okta's service/product to spam and/or send unsolicited messages. > Please refrain from adding unrelated accounts to the directory as Okta is not responsible for, and disclaims any and all > liability associated with, the activation email's content. You, and you alone, bear responsibility for the emails sent to any recipients.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      sendEmail - Sends an activation email to the user if `true` (optional, default to true)
      Returns:
      UserActivationToken
      Throws:
      ApiException - if fails to make API call
    • activateUser

      public UserActivationToken activateUser(String id, Boolean sendEmail, Map<String,String> additionalHeaders) throws ApiException
      Activate a user Activates a user. Perform this operation only on users with a `STAGED` or `DEPROVISIONED` status. Activation of a user is an asynchronous operation. * The user has the `transitioningToStatus` property with an `ACTIVE` value during activation. This indicates that the user hasn't completed the asynchronous operation. * The user has an `ACTIVE` status when the activation process completes. Users who don't have a password must complete the welcome flow by visiting the activation link to complete the transition to `ACTIVE` status. > **Note:** If you want to send a branded user activation email, change the subdomain of your request to the custom domain that's associated with the brand. > For example, change `subdomain.okta.com` to `custom.domain.one`. See [Multibrand and custom domains](https://developer.okta.com/docs/concepts/brands/#multibrand-and-custom-domains). > **Note:** If you have optional password enabled, visiting the activation link is optional for users who aren't required to enroll a password. > See [Create user with optional password](/openapi/okta-management/management/tag/User/#create-user-with-optional-password). > **Legal disclaimer** > After a user is added to the Okta directory, they receive an activation email. As part of signing up for this service, > you agreed not to use Okta's service/product to spam and/or send unsolicited messages. > Please refrain from adding unrelated accounts to the directory as Okta is not responsible for, and disclaims any and all > liability associated with, the activation email's content. You, and you alone, bear responsibility for the emails sent to any recipients.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      sendEmail - Sends an activation email to the user if `true` (optional, default to true)
      additionalHeaders - additionalHeaders for this call
      Returns:
      UserActivationToken
      Throws:
      ApiException - if fails to make API call
    • deactivateUser

      public void deactivateUser(String id, Boolean sendEmail, String prefer) throws ApiException
      Deactivate a user Deactivates a user. Perform this operation only on users that do not have a `DEPROVISIONED` status. * The user's `transitioningToStatus` property is `DEPROVISIONED` during deactivation to indicate that the user hasn't completed the asynchronous operation. * The user's status is `DEPROVISIONED` when the deactivation process is complete. > **Important:** Deactivating a user is a **destructive** operation. The user is deprovisioned from all assigned apps, which might destroy their data such as email or files. **This action cannot be recovered!** You can also perform user deactivation asynchronously. To invoke asynchronous user deactivation, pass an HTTP header `Prefer: respond-async` with the request.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      sendEmail - Sends a deactivation email to the admin if `true` (optional, default to false)
      prefer - Request asynchronous processing (optional)
      Throws:
      ApiException - if fails to make API call
    • deactivateUser

      public void deactivateUser(String id, Boolean sendEmail, String prefer, Map<String,String> additionalHeaders) throws ApiException
      Deactivate a user Deactivates a user. Perform this operation only on users that do not have a `DEPROVISIONED` status. * The user's `transitioningToStatus` property is `DEPROVISIONED` during deactivation to indicate that the user hasn't completed the asynchronous operation. * The user's status is `DEPROVISIONED` when the deactivation process is complete. > **Important:** Deactivating a user is a **destructive** operation. The user is deprovisioned from all assigned apps, which might destroy their data such as email or files. **This action cannot be recovered!** You can also perform user deactivation asynchronously. To invoke asynchronous user deactivation, pass an HTTP header `Prefer: respond-async` with the request.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      sendEmail - Sends a deactivation email to the admin if `true` (optional, default to false)
      prefer - Request asynchronous processing (optional)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • reactivateUser

      public UserActivationToken reactivateUser(String id, Boolean sendEmail) throws ApiException
      Reactivate a user Reactivates a user. Perform this operation only on users with a `PROVISIONED` or `RECOVERY` [status](/openapi/okta-management/management/tag/User/#tag/User/operation/listUsers!c=200&path=status&t=response). This operation restarts the activation workflow if for some reason the user activation wasn't completed when using the `activationToken` from [Activate User](/openapi/okta-management/management/tag/UserLifecycle/#tag/UserLifecycle/operation/activateUser). Users that don't have a password must complete the flow by completing the [Reset password](/openapi/okta-management/management/tag/UserCred/#tag/UserCred/operation/resetPassword) flow and MFA enrollment steps to transition the user to `ACTIVE` status. If `sendEmail` is `false`, returns an activation link for the user to set up their account. The activation token can be used to create a custom activation link.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      sendEmail - Sends an activation email to the user if `true` (optional, default to false)
      Returns:
      UserActivationToken
      Throws:
      ApiException - if fails to make API call
    • reactivateUser

      public UserActivationToken reactivateUser(String id, Boolean sendEmail, Map<String,String> additionalHeaders) throws ApiException
      Reactivate a user Reactivates a user. Perform this operation only on users with a `PROVISIONED` or `RECOVERY` [status](/openapi/okta-management/management/tag/User/#tag/User/operation/listUsers!c=200&path=status&t=response). This operation restarts the activation workflow if for some reason the user activation wasn't completed when using the `activationToken` from [Activate User](/openapi/okta-management/management/tag/UserLifecycle/#tag/UserLifecycle/operation/activateUser). Users that don't have a password must complete the flow by completing the [Reset password](/openapi/okta-management/management/tag/UserCred/#tag/UserCred/operation/resetPassword) flow and MFA enrollment steps to transition the user to `ACTIVE` status. If `sendEmail` is `false`, returns an activation link for the user to set up their account. The activation token can be used to create a custom activation link.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      sendEmail - Sends an activation email to the user if `true` (optional, default to false)
      additionalHeaders - additionalHeaders for this call
      Returns:
      UserActivationToken
      Throws:
      ApiException - if fails to make API call
    • resetFactors

      public void resetFactors(String id) throws ApiException
      Reset the factors Resets all factors for the specified user. All MFA factor enrollments return to the unenrolled state. The user's status remains `ACTIVE`. This link is present only if the user is currently enrolled in one or more MFA factors.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      Throws:
      ApiException - if fails to make API call
    • resetFactors

      public void resetFactors(String id, Map<String,String> additionalHeaders) throws ApiException
      Reset the factors Resets all factors for the specified user. All MFA factor enrollments return to the unenrolled state. The user's status remains `ACTIVE`. This link is present only if the user is currently enrolled in one or more MFA factors.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • suspendUser

      public void suspendUser(String id) throws ApiException
      Suspend a user Suspends a user. Perform this operation only on users with an `ACTIVE` status. The user has a `SUSPENDED` status when the process completes. Suspended users can't sign in to Okta. They can only be unsuspended or deactivated. Their group and app assignments are retained.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      Throws:
      ApiException - if fails to make API call
    • suspendUser

      public void suspendUser(String id, Map<String,String> additionalHeaders) throws ApiException
      Suspend a user Suspends a user. Perform this operation only on users with an `ACTIVE` status. The user has a `SUSPENDED` status when the process completes. Suspended users can't sign in to Okta. They can only be unsuspended or deactivated. Their group and app assignments are retained.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • unlockUser

      public void unlockUser(String id) throws ApiException
      Unlock a user Unlocks a user with a `LOCKED_OUT` status or unlocks a user with an `ACTIVE` status that's blocked from unknown devices. Unlocked users have an `ACTIVE` status and can sign in with their current password. > **Note:** This operation works with Okta-sourced users. It doesn't support directory-sourced accounts such as Active Directory.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      Throws:
      ApiException - if fails to make API call
    • unlockUser

      public void unlockUser(String id, Map<String,String> additionalHeaders) throws ApiException
      Unlock a user Unlocks a user with a `LOCKED_OUT` status or unlocks a user with an `ACTIVE` status that's blocked from unknown devices. Unlocked users have an `ACTIVE` status and can sign in with their current password. > **Note:** This operation works with Okta-sourced users. It doesn't support directory-sourced accounts such as Active Directory.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • unsuspendUser

      public void unsuspendUser(String id) throws ApiException
      Unsuspend a user Unsuspends a user and returns them to the `ACTIVE` state. This operation can only be performed on users that have a `SUSPENDED` status.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      Throws:
      ApiException - if fails to make API call
    • unsuspendUser

      public void unsuspendUser(String id, Map<String,String> additionalHeaders) throws ApiException
      Unsuspend a user Unsuspends a user and returns them to the `ACTIVE` state. This operation can only be performed on users that have a `SUSPENDED` status.
      Parameters:
      id - An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • getObjectMapper

      protected static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()