# Master Data

## Overview

The MDMS (Master Data Management Service) in DIGIT stores reusable, static configuration data like service definitions, role mappings, department codes, etc.

* **MDMS V2 -** All data is stored in a **central database**, which offers:
  * 🔍 Faster search and lookup
  * ⚙️ Dynamic updates (no need to redeploy code for small changes)
  * 🛠️ API-based management (Postman support)
  * 🔄 Easier feature upgrades

### Master Data List of CMS

<table><thead><tr><th width="167.96875">Category</th><th width="209.0078125">Purpose</th><th>MDMS Entries</th></tr></thead><tbody><tr><td><strong>Access Control</strong></td><td>User roles and permissions</td><td><p>- ACCESSCONTROL-ACTIONS-TEST.actions-test</p><p>- ACCESSCONTROL-ROLEACTIONS.roleactions</p><p>- ACCESSCONTROL-ROLES.roles</p></td></tr><tr><td><strong>Tenant</strong> </td><td>Manage city and tenant setup</td><td><p>- Tenant.citymodule</p><p>- Tenant.tenants</p></td></tr><tr><td><strong>Common Masters</strong></td><td>General-purpose reusable master data across modules</td><td><p>- common-masters.CronJobAPIConfig</p><p>- common-masters.Department</p><p>- common-masters.Designation</p><p>- common-masters.GenderType</p><p>- common-masters.IdFormat</p><p>- common-masters.StateInfo</p><p>- common-masters.uiHomePage</p><p>- common-masters.wfSlaConfig</p></td></tr><tr><td><strong>Data Security</strong></td><td>Encryption, decryption, and masking of data</td><td><p>- DataSecurity.DecryptionABAC</p><p>- DataSecurity.EncryptionPolicy</p><p>- DataSecurity.MaskingPatterns</p><p>- DataSecurity.SecurityPolicy</p></td></tr><tr><td><strong>HRMS (Human Resource Management System)</strong></td><td>Defines employee-related master data</td><td><p>- egov-hrms.DeactivationReason</p><p>- egov-hrms.Degree</p><p>- egov-hrms.EmployeeStatus</p><p>- egov-hrms.EmployeeType</p><p>- egov-hrms.EmploymentTest</p><p>- egov-hrms.Specalization</p></td></tr><tr><td><strong>PGR (Public Grievance Redressal)</strong></td><td>Defines complaint types, categories, and UI behavior</td><td><p>- RAINMAKER-PGR.ServiceDefs</p><p>- RAINMAKER-PGR.UIConstants</p></td></tr><tr><td><strong>Workflow</strong></td><td>Defines behavior of workflows across services</td><td><p>- Workflow.AutoEscalation</p><p>- Workflow.AutoEscalationStatesToIgnore</p><p>- Workflow.BusinessService</p><p>- Workflow.BusinessServiceConfig</p><p>- Workflow.BusinessServiceMasterConfig</p></td></tr><tr><td><strong>Inbox</strong></td><td>master data of the Inbox UI and queries</td><td>- INBOX.InboxQueryConfiguration</td></tr></tbody></table>

***

## Pre-requisites for Loading Master Data&#x20;

* Postman installed
* Access to the MDMS V2 service (port-forwarded or public URL)
* Valid environment URL and login credentials
* MDMS Admin authtoken&#x20;

## Steps - Schema Upload

{% stepper %}
{% step %}

### Import Postman Collection&#x20;

* Open the [Postman collection](https://api.postman.com/collections/23418568-77d9a201-e633-4276-8286-c98edb9979b5?access_key=PMAT-01K06MD3646C1ZBZQ9V98HSTTD).
* Copy the above Postman collection. &#x20;
* Click on the **Import** icon in Postman.
* Paste the URL and import the collection.
* After import, you’ll find the collection on the **left panel** of Postman.
  {% endstep %}

{% step %}

### Add Required Variables in Postman Collection (Before Running MDMS Script)

* Before proceeding to the next step, make sure the prerequisites baseUrl and authtoken are updated.
* Make sure your Postman environment has the following values updated:
  * baseUrl (e.g., [https://unified-demo.digit.org](https://pgr-demo.digit.org/))  (This is the domain URL where your application is running . Need to copy that domain URL here).
  * User Details (Mdsm user) (Which was created during the installation . Need to copy username, password and tenantid of the mdmsAdmin user)
  * tenantId (e.g., pb, uk) (In the  request body, need to verify or update the tenantId where going to set up the master data )
* Before executing the MDMS v2 Schema Creation collection, make sure to add the following variables in the collection's variable section in Postman:

<table><thead><tr><th width="147.4765625">Variable Name</th><th>Description</th></tr></thead><tbody><tr><td>Url</td><td><p>The domain URL where your DIGIT application is hosted. Example: https://pgr-demo.digit.org</p><p>📌 Add this in the "Url" variable field.</p></td></tr><tr><td>username</td><td><p>The admin username for MDMS (e.g., mdms admin). Required for authentication.</p><p>📌 Add this in the "username" variable field.</p></td></tr><tr><td>password</td><td><p>The admin password for the above username.</p><p>📌 Add this in the "password" variable field.</p></td></tr><tr><td>tenant</td><td><p>The state-level tenant ID (e.g., pg).</p><p>📌 Add this in the "tenant" variable field.</p></td></tr><tr><td>userTenant</td><td><p>The ULB-level tenant ID where the user has been created (e.g., pg).</p><p>📌 Add this in the "userTenant" variable field.</p></td></tr></tbody></table>

* &#x20;Refer to the screenshot below showing Postman → Variables tab with all fields filled.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe2BMW6vCvNZaM7YgJrseWykmV6aFXYdVWfJpXjFfB4kKs2OJYDFbSIuT-0B-RPLYcW75CvF4oMH7XLIk_4cRKxy8cqWQB-c-15L27atDH-V90lbCUD67zo4V30oEdeYG4ZQSk01A?key=4vIdmt73mUh-cJZAdQrc2w)

{% endstep %}

{% step %}

### Final Checklist Before Running

* Variables are filled correctly as per the environment.
* Admin user created, and credentials are working.
* The collection is imported and opened in Postman.
* No missing or invalid values.
  {% endstep %}

{% step %}

### Run the Postman collection

* Open Postman and locate the collection named "MDMS v2 Schema Creation".
* Click the three dots (⋮) next to the collection name (on the right side). Refer to the screenshot for the exact location.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe5WqrqnnqJfpPk8MIxG9jG1Ce62FbgoDHnDC4C615qNdiL1rFyrqyCCac0uGhHJjeCl0XYEjPThuZMnLKSqFLjgRDw-cIV0jKfdNso0iZf5PQdgTaXw9sAZceG0QDvHFomKg9sCA?key=4vIdmt73mUh-cJZAdQrc2w)

* From the dropdown menu, select "Run Collection". This will open the Collection Runner window. On the right side of the new screen, you’ll see an orange button labelled "Run MDMS v2 Schema Creation" — click this.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXf2rcyytup4j58gLY_4PDY6kfYD3Hzl6PLdkNYnGGgkMcApWdE2eVOOZiU78mj2ptsiQqskrbVw0qlUZACxqG086G5V2cL4ChphAkhqAUkQ2Qp8xTVhRRmhWzD3pRboUzaP707V?key=4vIdmt73mUh-cJZAdQrc2w)

* The collection will now start running. You will see each API request and its response as they execute.
  {% endstep %}

{% step %}

### Check Results

* ✅ If all requests succeed (green checkmarks), your MDMS setup for Inbox V2 is complete.
* ❌ If any request fails (red cross), re-run the collection to retry the failed steps.

{% hint style="info" %}

#### Important Note

Master data creation should only be done after completing the schema creation step successfully. You must not proceed with uploading actual master data until:

* The MDMS schema creation collection has been executed successfully
* No API failures were observed during execution

If any API fails during schema creation, fix the issue and rerun the schema collection before moving ahead.

⛔ Do not attempt to push master data if the schema setup is incomplete — it will result in errors.
{% endhint %}
{% endstep %}
{% endstepper %}

***

## **Steps -** Data Upload - Actual Master Data

{% stepper %}
{% step %}

### Import Postman Collection

* Open the [Postman collection](https://api.postman.com/collections/23418568-ecad8e2f-c274-46e7-928e-e1f5eff457ea?access_key=PMAT-01K06PEG4NEZXW34EVXSD7K4XF).
* Copy the above Postman collection. &#x20;
* Click on the **Import** icon in Postman.
* Paste the URL and import the collection.
* After import, you’ll find the collection on the **left panel** of Postman.
  {% endstep %}

{% step %}

### Add required variables in the Postman collection (before running the MDMS script)

* Before proceeding to the next step, make sure the baseUrl and authtoken are updated.&#x20;
* Make sure your Postman environment has these updated values:
  * baseUrl (e.g., [https://unified-demo.digit.org](https://unified-demo.digit.org/))  (This is the domain URL where your application is running . Need to copy that domain URL here)
  * User Details (Mdsm user) (Which was created during the installation . Need to copy username, password, and tenantid of the mdmsAdmin user)
  * tenantId (e.g., pb, uk) (In the  request body, need to verify or update the tenantId where going to set up the master data )
* Before executing the MDMS v2 data Creation collection, make sure to add the following variables in the collection's variable section in Postman:

<table><thead><tr><th width="166.62109375">Variable Name</th><th>Description</th></tr></thead><tbody><tr><td>Url</td><td><p>The domain URL where your DIGIT application is hosted. Example: https://pgr-demo.digit.org</p><p>📌 Add this in the "Url" variable field.</p></td></tr><tr><td>username</td><td><p>The admin username for MDMS (e.g., mdms admin). Required for authentication.</p><p>📌 Add this in the "username" variable field.</p></td></tr><tr><td>password</td><td><p>The admin password for the above username.</p><p>📌 Add this in the "password" variable field.</p></td></tr><tr><td>tenant</td><td><p>The state-level tenant ID (e.g., pg).</p><p>📌 Add this in the "tenant" variable field.</p></td></tr><tr><td>userTenant</td><td><p>The ULB-level tenant ID where the user has been created (e.g., pg).</p><p>📌 Add this in the "userTenant" variable field.</p></td></tr></tbody></table>

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe2BMW6vCvNZaM7YgJrseWykmV6aFXYdVWfJpXjFfB4kKs2OJYDFbSIuT-0B-RPLYcW75CvF4oMH7XLIk_4cRKxy8cqWQB-c-15L27atDH-V90lbCUD67zo4V30oEdeYG4ZQSk01A?key=4vIdmt73mUh-cJZAdQrc2w)

Refer to the screenshot above showing Postman → Variables tab with all fields filled.
{% endstep %}

{% step %}

### Final Checklist Before Running

* Variables are filled correctly as per the environment.
* Admin user created, and credentials are working.
* The collection is imported and opened in Postman.
* No missing or invalid values.
  {% endstep %}

{% step %}

### Run the Postman Collection for master data creation

* Open Postman and locate the collection named "MDMS v2 data Creation".
* Click the three dots (⋮) next to the collection name (on the right side).

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe5WqrqnnqJfpPk8MIxG9jG1Ce62FbgoDHnDC4C615qNdiL1rFyrqyCCac0uGhHJjeCl0XYEjPThuZMnLKSqFLjgRDw-cIV0jKfdNso0iZf5PQdgTaXw9sAZceG0QDvHFomKg9sCA?key=4vIdmt73mUh-cJZAdQrc2w)\
\
Refer to the screenshot above for the exact location.

* From the dropdown menu, select "Run Collection". This will open the Collection Runner window. On the right side of the new screen, you’ll see an orange button labelled "Run MDMS v2 data Creation" — click this.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXf2rcyytup4j58gLY_4PDY6kfYD3Hzl6PLdkNYnGGgkMcApWdE2eVOOZiU78mj2ptsiQqskrbVw0qlUZACxqG086G5V2cL4ChphAkhqAUkQ2Qp8xTVhRRmhWzD3pRboUzaP707V?key=4vIdmt73mUh-cJZAdQrc2w)

* The collection will now start running. You will see each API request and its response as they execute.
  {% endstep %}

{% step %}

### Check Results

* ✅ If all requests succeed (green checkmarks), the steps are complete.
* ❌ If any request fails (red cross), re-run the collection to retry the failed steps.

{% endstep %}
{% endstepper %}

## **Steps - Upload Master Data Using API**&#x20;

To confirm that your master schema was uploaded successfully, follow the steps below:

{% stepper %}
{% step %}

### Import the below cURL request into Postman

Refer to earlier instructions for how to import a cURL into Postman
{% endstep %}

{% step %}

### Update fields

Update the fields as given below:

* Replace \<domain\_url> with your actual domain URL (e.g., <https://pgr-demo.digit.org>)
* Under SchemaDefCriteria, update the "code" field with the schema code. (You can find the code in the response of each schema create API call.
  {% endstep %}

{% step %}

### Curl import in Postman

Example curl (to be imported in Postman)

```
curl --location 'http://localhost:8082/mdms-v2/schema/v1/_search' \
--header 'Content-Type: application/json' \
--data '{
    "RequestInfo": {
        "apiId": "asset-services",
        "ver": null,
        "ts": null,
        "action": null,
        "did": null,
        "key": null,
        "msgId": "search with from and to values",
        "authToken": "dfcca143-b5a6-4726-b5cd-c2c949cb0f2b",
        "correlationId": null,
        "userInfo": {
            "id": "1",
            "userName": null,
            "name": null,
            "type": null,
            "mobileNumber": null,
            "emailId": null,
            "roles": null
        }
    },
    "SchemaDefCriteria": {
        "tenantId": "pg",
        "codes":["common-masters.StateInfo"]
    }
}'
```

{% endstep %}

{% step %}

### Run the request

Run the request and check the response to verify that your schemas are correctly uploaded.
{% endstep %}
{% endstepper %}

## Steps MDMS V2 Data Search – Verify Uploaded Master Data

You can use this API to search and verify the master data records you uploaded via the MDMS V2 create APIs.

{% stepper %}
{% step %}

### Import the below cURL in Postman

(Refer to earlier steps if unsure how to import cURL)
{% endstep %}

{% step %}

### Update fields:

Update the fields as given below:

* Replace localhost:8086 with your actual domain URL\
  (e.g., <https://pgr-demo.digit.org>)
* Replace the authToken with a valid session token (you can get this from the login response).
* Replace the "schemaCode" with the code of the schema you used while uploading data (you can get it from the create API responses).
  {% endstep %}

{% step %}

### Example Curl

```
curl --location 'http://<your-domain>/mdms-v2/v2/_search' \
--header 'Content-Type: application/json' \
--data '{
  "RequestInfo": {
    "apiId": "asset-services",
    "ver": null,
    "ts": null,
    "action": null,
    "did": null,
    "key": null,
    "msgId": "search with from and to values",
    "authToken": "<your-valid-auth-token>",
    "correlationId": null,
    "userInfo": {
      "id": "1"
    }
  },
  "MdmsCriteria": {
    "tenantId": "pg",
    "schemaCode":"ACCESSCONTROL-ACTIONS-TEST.actions-test",
    "limit":100000
  }
}' 
```

{% endstep %}
{% endstepper %}

{% hint style="info" %}

#### 📌 Notes:

* Make sure the schemaCode matches exactly what you created during the data upload.
* You should receive a JSON response with all the master records under that schema.
* If you get an empty array, it means either:
  * Data wasn’t created successfully, or
  * The schema code or tenant ID is incorrect.<br>
    {% endhint %}

### Useful Resources

<table><thead><tr><th width="312.70703125">Type</th><th>Link</th></tr></thead><tbody><tr><td>MDMS V2 Data Migration Postman</td><td><a href="https://api.postman.com/collections/23418568-ecad8e2f-c274-46e7-928e-e1f5eff457ea?access_key=PMAT-01K06PEG4NEZXW34EVXSD7K4XF">Postman Collection</a></td></tr><tr><td>Schema Creation Postman</td><td><a href="https://api.postman.com/collections/23418568-77d9a201-e633-4276-8286-c98edb9979b5?access_key=PMAT-01K06MD3646C1ZBZQ9V98HSTTD">Postman Collection</a></td></tr><tr><td>MDMS v2 APIs Search/Create</td><td><a href="https://api.postman.com/collections/23418568-d3927ea4-d6b4-4b41-9765-0a4f7c710e3f?access_key=PMAT-01JVPD84YD4H96Y3RWH4VDRE3J">Postman Collection</a></td></tr><tr><td>Video Walkthrough</td><td><a href="https://drive.google.com/file/d/1wuOOi1Kp0rYLw_y8reL_Jjkc7omP4Xij/view">Google Drive Video</a></td></tr></tbody></table>

***

## &#x20;Notes

<table><thead><tr><th width="175.7421875">Item </th><th>Description</th></tr></thead><tbody><tr><td>Schema code format</td><td>The schema <code>code</code> must follow the format: <code>moduleName.masterName</code>. This ensures correct linking between schema and data.</td></tr><tr><td>Master data is tenant-specific</td><td>Every record must be linked to a specific tenant (like a city or ULB). You must provide the correct <code>tenantId</code> while uploading or searching.</td></tr><tr><td>Port forwarding for local testing</td><td>If testing locally, make sure services are port-forwarded (especially <code>mdms-v2</code>, <code>egov-user</code>, and <code>egov-apigateway</code>).</td></tr><tr><td>Reverse Order Loading</td><td>The UI may render fields in reverse order of the JSON array, so to show the first field at the top, you may need to place it last in the array.</td></tr></tbody></table>
