Bulk keys and export
Make or bring in up to a thousand keys, act on up to five hundred at once, and export keys as JSON or CSV.
Everything here changes or reads many keys of one project in one call. Making, changing and deleting need a key with the keys:write scope; exporting only reads. These routes take bodies up to 512 KB; every other route stops at 16 KB.
Make many keys
POST /v3/projects/:id/users/bulk
Send count (1 to 1000) to make that many keys, or users (1 to 1000) to bring in keys you already have, as when you move from Luarmor. One or the other, not both.
{ "count": 200, "note": "Giveaway", "key_days": 30 }{
"users": [
{ "user_key": "AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEf", "note": "from Luarmor", "discord_id": "123456789012345678", "auth_expire": 1893456000 }
]
}With count, note, key_days and auth_expire are the same as for one key (lifetime when neither end is given). With users, each entry takes user_key (32 letters) and optionally note, discord_id, identifier, key_days or auth_expire. The answer has created and, for count, the user_keys; for users, a skipped list of keys that already existed (code KEY_EXISTS). The plan's key limit is checked under a lock: a call that does not fit makes nothing (403 PLAN_LIMIT), and calls arriving side by side cannot pass it together.
Act on many keys
| Route | What it does |
|---|---|
| POST /v3/projects/:id/users/bulk/ban | Bans the keys (reason, until as for one key). The answer has an unban_tokens object, one token per key. |
| POST /v3/projects/:id/users/bulk/unban | Lifts the bans. |
| POST /v3/projects/:id/users/bulk/resethwid | Frees the keys from their devices (reset-hwid works too). Skips the project's cooldown, like an owner's reset. |
| POST /v3/projects/:id/users/bulk/delete | Deletes the keys. Each one is written to the audit log. |
| POST /v3/projects/:id/users/bulk/extend | Adds days (1 to 36500). A key that already ended gets the days from today; one still running gets them added to its end; an unused "days from first use" key gets more days; a lifetime key is left alone and listed in unchanged. |
{ "user_keys": ["AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEf", "ZyXwVuTsRqPoNmLkJiHgFeDcBaZyXwVu"], "days": 30 }user_keys holds 1 to 500 keys (repeats count once). The answer has updated and not_found, the keys that are not in this project (another project's or another workspace's keys look the same). Each change is written to the keys' history with the API key's name.
Export keys
GET /v3/projects/:id/users/export
| Parameter | Meaning |
|---|---|
| format | json (default) or csv. |
| status | unused, active, reset or banned. |
| limit | Keys per call, 1 to 50000; defaults to 10000. |
| cursor | The next_cursor of the previous call. |
Keys come oldest first and the pages join up with no repeat and no gap, even for keys made in the same moment. JSON answers users, count and next_cursor (null on the last page). CSV has a header row and the same columns as a key in the list; the cursor is in the X-Next-Cursor header. A cell that starts with =, +, - or @ is written with a leading quote so a spreadsheet shows it as text, never as a formula.