User data import and export
Xsolla Login allows you to import and export user data in CSV format. It can be useful when you need to create a backup copy of user data or migrate data from another authorization service.
You can export and import user data via Login API. Exporting, unlike importing, is also available in Publisher Account.
User data import
To import user data into Xsolla Login:
- Create field mapping — a JSON file containing field numbers and names. The index in the mapping should start at 0.
Notice
Bcrypt is the only supported password encryption type. If you use another encryption type, add verified user email to the mapping — when a user signs up, they will receive a one-time link to change their password.
Copy
- json
{
"email": 0,
"email_verified": 1,
"user_id": 2,
"is_active": 3,
"username": 4,
"birth_date": 5,
"gender": 6,
"full_name": 7,
"last_name": 8,
"first_name": 9,
"nickname": 10,
"picture": 11,
"password_hash": 12
}
- Create a database in CSV format. There must be no headings in the database.
email
is a required field. Maximum file size: 64 MB. For more information about the supported data types, refer to the table with parameter descriptions.
email1@example.com | true | 12qw34er56 |
email2@example.com | false | ty78qw12rt34 |
email3@example.com | false | 4er5612qw3 |
email4@example.com | true | t12rt34y78qw |
email5@example.com | true | 12rt34ty78qw |
- Specify the attribute validation rules in JSON Schema format (optional).
- Pass the created mapping and database in the Import user data API call.
Note
Xsolla doesn’t notify you whether data import was successful or resulted in an error. To know the import status, contact your Customer Success Manager or email to csm@xsolla.com.
User data export
Note
If you configured the JSON Scheme, there will be user attribute validation when exporting user data.
User data export via Publisher Account
- Open your project in Publisher Account.
- In the side menu, click Login.
- Click Configure in the Login project pane.
- Go to the User database > Users section.
- Click Export users.
- In the opened window, enter the email where you want to receive the archive of user data.
- Click Export.
Note
The password for the archive is your secret key. You can find it in the Security > JWT signature section in the Login project pane.
User data export via API
To export user data via API, call the Export user data method.Description of parameters used to import data
Parameter | Type | Description |
---|---|---|
string | Maximum length: 255 symbols. | |
email_verified | boolean | Status of email verification. If the field is empty, true is used. |
user_id | string | Maximum length: 255 symbols. |
is_active | boolean | Status of user account verification. If the field is empty, true is used. |
username | string | If the field is empty, username is used. Maximum length: 255 symbols. |
birth_date | date | Maximum length: 255 symbols. |
gender | string | Maximum length: 20 symbols. |
full_name | string | Maximum length: 255 symbols. |
last_name | string | Maximum length: 255 symbols. |
first_name | string | Maximum length: 255 symbols. |
nickname | string | Maximum length: 255 symbols. |
phone_number | string | User phone number according to the E.123 standard. Should be prefixed by the + sign. Can contain spaces. Dashes and parentheses are not allowed. Example: +22 607 123 4567 or +226071234567 . Maximum length: 30 symbols. |
picture | string | Link to a user’s avatar. Maximum length: 1024 symbols. |
password_hash | string | Maximum length: 64 symbols. |
server_custom_id | string | Custom user ID that already exists on your server. Maximum length: 255 symbols. |
Was this article helpful?
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.Rate this page
Rate this page
Don’t want to answer
Thank you for your feedback!
Found a typo or other text error? Select the text and press Ctrl+Enter.