Introduction

If you're just beginning to implement Descope into your projects, you may want to migrate all of your existing users to the User Management portal in the Descope Console. This is a guide that shows you how to adapt your current user base to a JSON file in the correct format, and then upload them through the User Management Portal.

Formatting User Data JSON

  1. If your user data is in a CSV, you will need to convert the data into a JSON. There are many free online tools that will allow you to do this, such as csvjson.com.
  2. You will need to make sure your user data contains the correct headers and is organized in the correct manner. Every user in your JSON will must have an identifier and a displayName, along with either an email or phone number. The identifier can either be the email or the phone number depending on which one you decide to add. If your users have phone and email data, then your JSON should look something like this:

If you are adding users with just email data, the JSON should look like this:

[
  {
    "identifier": "example@descope.com",
    "displayName": "Test User",
    "email": "example@descope.com"
  }
]

If you only have phone data, the JSON should look like this instead:

[
  {
    "identifier": "+14151234567",
    "displayName": "Test User",
    "phoneNumber": "+14151234567"
  }
]

If you want to add both an email or phone number, along with custom attributes and other parameters, this is what a fully loaded JSON will look like (you can just remove the key/value pairs you do not have data for):

[
  {
    "identifier": "example@descope.com",
    "displayName": "Test User",
    "email": "example@descope.com",
    "phoneNumber": "+14151234567",
    "verifiedEmail": true,
    "verifiedPhone": false,
    "authorization": {
      "roles": [
          {"id": "xxxx"}
        ]
    },
    "tenants": [],
    "status": "enabled",
    "test": false,
    "customAttributes": {
      "custom_att": "sample_value"
    }
  },
  {
    "identifier": "example1@descope.com",
    "displayName": "Test User 1",
    "email": "example1@descope.com"
  },
  ...
]

NOTE: If you would like to include custom attributes to your user, as I have done in the JSON above, you will need to make sure they are first created with the same key here. If you have not added they attribute key, the user will still be added to the main list, but will not be assigned the custom attribute value.

  1. Once you have created the file, all you will have to do is head to the Users Management page and select Import Users in the top right corner.
Descope import user guide - import users button.

Once the import is complete, refresh the page and you should see all of your users there. Now you can go ahead and manage them either from within the Descope Console or with any of our SDKs and APIs.

If you have any other questions about Descope or adding users, feel free to reach out to us!