Levels import format
The CSV and JSON files /levels import file reads, with every field, the limits and examples.
/levels import file reads levels from a CSV or JSON file. Use it when your old bot can export its leaderboard, or when you made a list yourself. The Levels page covers the other imports and how the preview and undo work.
Fields
Each member is one row, with user_id and either xp or level.
| Field | Needed | What it is |
|---|---|---|
user_id | Yes | The member's Discord user id, 15 to 20 digits |
xp | xp or level | Total XP, a whole number up to 1,000,000,000,000,000 |
level | xp or level | A level from 0 to 10,000. Element gives the XP that level needs on your server's curve |
progress | No | How far into the level, from 0 to 100 percent, with up to 6 decimals. Only with level |
messages | No | Messages sent, a whole number. The mode decides how it combines with what the member has |
voice_minutes | No | Minutes in voice, a whole number. The mode applies here too |
- A row can't have both
xpandlevel. Pick one for each member. - Each member can only be in the file once.
- Other columns or fields are ignored, so an export with extra columns works as it is.
- Imported messages go into the member's all-time total, not this week's or month's.
- Bots are skipped. Members who left are imported and show again if they come back, unless the server deletes XP on leave.
CSV
A UTF-8 file with a header row. Column order doesn't matter.
user_id,xp,messages,voice_minutes
111111111111111111,52000,1840,600
222222222222222222,12556,410,
333333333333333333,980,52,15
With levels instead of XP:
user_id,level,progress
111111111111111111,20,45.5
222222222222222222,10,0
Leave a cell empty to skip it, like the second member's voice minutes above. Excel's "CSV UTF-8" works, but check it didn't turn the user ids into numbers like 1.11111E+17. Format the column as text before you paste the ids.
JSON
An object with a members list. format is optional, but when it's there it has to be element-levels/1.
{
"format": "element-levels/1",
"members": [
{ "user_id": "111111111111111111", "xp": 52000, "messages": 1840, "voice_minutes": 600 },
{ "user_id": "222222222222222222", "level": 10, "progress": 25 }
]
}
User ids must be strings in quotes. JSON numbers can't hold an 18-digit id exactly, so a number is refused. Other numbers can be written with or without quotes.
Limits
| File name | Ends in .csv or .json |
| File size | Up to 10 MB |
| Members | Up to 500,000 |
| XP | Up to 1,000,000,000,000,000 |
| Messages | Up to 1,000,000,000,000 |
| Voice minutes | Up to 2,147,483,647 |
| Level | Up to 10,000 |
Numbers can't be negative, and only progress may have decimals.
If a row is wrong, Element names the first one, by its line in a CSV or its number in the JSON list, and says what to fix. Nothing is imported until the whole file reads cleanly.
After you upload
The preview shows how many members the file has, how many are still in the server and how many change level, with the top 10 before and after. Pick a mode:
- Keep the higher, the default: each member keeps whichever is higher, what they have now or the file's numbers. Safe to run more than once.
- Replace: the file's numbers replace what members have.
- Add: the file's numbers are added to what members have.
The mode applies to XP, messages and voice minutes alike, so Replace also replaces message and voice totals.
Press Import to run it. /levels import undo puts the newest import back for 7 days, but XP members earned since the import is lost. Messages sent since then still count.
Moving to another server
Element's own export writes this same JSON format, so it imports back as it is. Ask on the support server if you need one. It has XP, messages and voice minutes only: no prestige and no per-channel counts. A server with no levels gives an empty file, which can't be imported ("The file has no members in it").