# Update Profile

## 1. **Create Session Token** :&#x20;

First Step When Customer Click On Update  You Have To Initialize Session First By Creating Session Token Using The Following API :

{% openapi src="/files/wupiJ86EBIpDAoKbqINZ" path="/api/v1/Auth/GenerateUpdateRequestSessionToken" method="post" %}
[enROLLCollection.json](https://3826285197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGM6tCcdsukNbOigN9U2m%2Fuploads%2FkUyWYX9DkD4UK6x9L9YL%2FenROLLCollection.json?alt=media\&token=71011f45-89fc-404f-9e8c-090198ef940c)
{% endopenapi %}

{% hint style="info" %}
UpdateSteps you Select Which Steps To Update Only These Steps Will Be Allowed To Update In This Session For This User. If You Wich To Allow All Leave This Array Empty&#x20;
{% endhint %}

<pre><code>// Available Steps are
        NationalID = 1,   
        Passport = 2,
        Phone = 3,
        Email = 4,
        Device = 5,      
<strong>        Location = 6,        
</strong>        SecurityQuestions = 7,
        Password = 8
</code></pre>

## 2.  **Import eNROLL JS File in index.html :**&#x20;

{% file src="/files/jj84b6q4JN0PzP663HGg" %}

```html
<script src="eNROLL.min.js"></script>
```

## 3. Add Div Element With Specifying Id For This Div

```html
<div id="myDiv">
</div>
```

## 4. Initialize eNroll Component Any Where In Your JS File After      Document Is Loaded:

<pre class="language-javascript"><code class="lang-javascript">eNROLL.init({
   elementId:"myDiv", // The Id We Set Before For Our Div
   url:"{{environment.url}}", // this parameter is sent to you by email after acceptiong your org 
   sessionId://Token We Got In Step 1 From The API,
   mode:"reEnroll" | "update",
        //rEnroll : User Will Update All Profile 
        //update : User  Will Select What to Update
   onExit:()=>{
<strong>     // define What Happen When User Exit From eNROLL Plugin
</strong>  }
});
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lumin-soft.gitbook.io/ekyc/integration-guide/web-plugin/update-profile.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
