# Migration to UsersOrchestrator API

## **Introduction** <a href="#migrationfromusertousersorchestrator-intro" id="migrationfromusertousersorchestrator-intro"></a>

This section outlines the process to be followed in order to migrate from the old UserAPI endpoints to the new UsersOrchestratorAPI endpoints. This section also shows a comparison of the old and new APIs.

The endpoints covered in this section are as listed below:

1. [Get By Id](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/get-by-id)
2. [Get By Email](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/get-by-email)
3. [Get By Query String](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/get-by-query-string)
4. [Get By Encrypted Email](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/get-by-encrypted-email)
5. [Get By Encrypted Id](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/get-by-encrypted-id)
6. [Get By Token](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/get-by-token)
7. [Create User](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/create-user)
8. [Create Passwordless User](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/create-passwordless-user)
9. [Update User](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/update-user)
10. [Update Password](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/update-password)
11. [Update Email](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/update-email)
12. [Authenticate / Authenticate By Token](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/authenticate-authenticate-by-token)
13. [ForgotPassword](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/forgotpassword)
    1. [ForgotPassword (Start)](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/forgotpassword#forgotpassword-start)
    2. [ForgotPassword (Validity)](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/forgotpassword#forgotpassword-validate)
    3. [ForgotPassword (Finish)](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/forgotpassword#forgotpassword-finish)
14. [Verify Email](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/verify-email)
15. [Send Verification Code](https://docs.navigaglobal.com/naviga-subscribe-api/MhIk9TtEtuSKzip2tsSt/users-orchestrator-api/migration-to-usersorchestrator-api/send-verification-code)

{% hint style="danger" %}

## **ProxyAPI Information** <a href="#migrationfromentitlementstoentitlementsorchestrator-proxyapiinformation-important" id="migrationfromentitlementstoentitlementsorchestrator-proxyapiinformation-important"></a>

In order to redirect to UserAPI or to UsersOrchestratorAPI, ProxyAPI must have the following settings in place:

* MG2 Control Internal setting, **UsersOrchestrator** - Its value includes a "string.Format" that must be utilized to determine the correct API route. The value by default is "*{0}/UsersOrchestrator*".

**Note:** *Since the ProxyAPI directly calls the UsersOrchestratorAPI, GatewayAPI is not involved in the request chain.*
{% endhint %}

{% hint style="success" %}
**IgnoreProvider Considerations**

* This flag is included in the Body or QueryString of certain endpoints.
* This parameter is used to retrieve only SubscribeRegistration results while ignoring third-party integration services. This is an optional parameter that modifies the workflow execution.
  {% endhint %}

## **User States** <a href="#migrationfromusertousersorchestrator-userstates" id="migrationfromusertousersorchestrator-userstates"></a>

The UserOrchestrator API also includes the registration status in the API response.

1. The `GET /Users` and `GET /Users/id` endpoints will include the output parameter, **State**, which returns the status of a registration.
   * The registration's status will be returned as follows:
     * If the tenant has been associated with a third-party authentication system such as Auth0, Firefly, etc., the State will be returned as <mark style="color:purple;">**Standard**</mark>.
     * If the tenant has been associated with MG2 Auth:
       * When the *Password* field in the database remains blank, the State will be <mark style="color:purple;">**Lite**</mark>.
       * When the *Verified* field in the database has been set to False, the State will be <mark style="color:purple;">**Unverified**</mark>.
       * When the *Password* field hasn't been blank and the *Verified* field has been set to true, the State will be <mark style="color:purple;">**Standard**</mark>.
2. The `POST /Users` endpoint will display an error when trying to create a registration that already exists in the database and has the <mark style="color:purple;">**Verified**</mark> field set to false.
3. The `POST /Users/Authentication` endpoint will display an error when trying to login with an <mark style="color:purple;">**Unverified**</mark> or <mark style="color:purple;">**Lite**</mark> registration.
