Before you start
- Export your keys from the old system as CSV. A spreadsheet saved as CSV works.
- Create the app in AuthForge that the keys belong to.
- Ship a build of your software that uses the AuthForge SDK. An imported key works the moment the import finishes, but only in a build that asks AuthForge.
The file
The first line names the columns. Onlykey is required; leave out the columns you do not need.
Column names are matched without regard to upper and lower case, spaces or punctuation, so
License Key, license_key and licensekey are the same column. The exception is the part of a var. column after the dot, which is the variable’s name and is used exactly as written. Columns that match nothing are ignored, and the result tells you which ones.
The dashboard’s own Download CSV file has these columns, so it can be imported as it is. Its Created At column is not read: an imported license is created at the moment of the import.
The file can be comma, semicolon or tab separated; the import uses whichever the first line uses most. Quoted fields follow the usual CSV rules ("Smith, Bob", and "" for a quote inside quotes).
Key rules
- 8 to 64 characters.
- Letters, digits, hyphens, underscores and dots. The first character is a letter or a digit.
- Kept exactly as written. Keys are case-sensitive:
abcd-1234andABCD-1234are two different keys, and your customers must enter theirs the way it was imported.
/, + or =) cannot be imported.
Dates
expires accepts:
- a date:
2027-12-31(midnight UTC at the start of that day) - a date and time:
2027-12-31T23:59:59Z, with or without an offset; without one it is read as UTC - Unix time:
1830297599(seconds) or1830297599000(milliseconds)
31/12/2027 or never, is rejected rather than guessed at. A date in the past is imported as it is, and the license is expired from the start; the result marks those lines.
Status
A key that was switched off in your old system can be imported switched off, so your app is toldrevoked for it and not invalid_key.
Upper and lower case do not matter. The check report says how many keys will come in revoked before anything is written.
A word the import does not know is never guessed at.
inactive is the usual case: Lemon Squeezy uses it for a valid key that has no activations yet, and another system may use it for a key that was switched off. Guessing wrong would either let a banned key in or lock a paying customer out, so change the word to active or revoked yourself.
AuthForge has no stored “expired” status: a license is expired when its expiry date has passed. That is why expired needs the date, and why a line that says expired with no date or a future date is rejected.
License variables
A column namedvar. followed by a variable’s name sets that license variable on each license: var.tier sets tier. Your app receives it as part of licenseVariables, like a variable set in the dashboard.
- A cell is kept as text, whatever it looks like.
007,1.10andtrueare imported as the strings"007","1.10"and"true". This is also what the dashboard stores when you type a variable in by hand. - For a number or a true/false value, say so in the column name:
var.maxUsers:numberorvar.beta:boolean. The type is never worked out from the cells, so one odd cell cannot change the type of a whole column.- A
:numbercell is a decimal number such as5,-2or2.5. A whole number too large to be stored exactly (above 9,007,199,254,740,991) is rejected; import it as text. - A
:booleancell istrue,false,yes,no,1or0. - A cell that does not fit rejects its line, and the message names the column.
- A
- An empty cell leaves that variable unset on that license. Other licenses in the file can still have it.
- The name is used exactly as written, upper and lower case included:
var.Tierandvar.tierare two variables. Spaces around it are dropped. - The usual limits apply to each license: a name of at most 64 characters, at most 50 variables, and at most 4,096 bytes for all of a license’s variables together. A line over a limit is rejected.
variables is read as well. It holds all of a license’s variables as one JSON object, {"tier":"pro","maxUsers":5}, with the types JSON gives them. If a line has both, a var. column wins over the same name in the JSON.
Two columns that would set the same variable (var.tier and var.tier:number) stop the whole file, as two key columns would.
What happens to each line
Every line of the file ends up as one of these:
A line with any invalid field is rejected whole; nothing is imported half-filled. An import never changes or overwrites a license that already exists.
License keys are unique across all of AuthForge, not per app. A long random key will never collide. A short or sequential one (
00000042) may already be taken by someone else, and then it cannot be imported. If you have two apps of your own, a key can live in only one of them.Import from the dashboard
- Open the app and choose Import Keys above the license list.
- Choose your CSV file and select Check file. Nothing is written yet.
- Read the report: how many keys will be imported, how many of those as revoked, which license variables were read, how many keys are already in the app, how many cannot be imported and why. Download this report gives you one line for every line of your file.
- Fix the file if you need to and check it again, or select Import N licenses.
- Download the result for your records.
Remove an import
If you imported the wrong file, you do not have to delete its licenses page by page.- Open the app and choose Import Keys.
- Under Earlier imports, find the import by its date and number of licenses and choose Remove. Straight after an import, Remove this import on the result screen does the same.
- Read the confirmation and choose Delete N licenses.
license.deleted does not fire). Licenses the removal deleted still count toward that day’s import limit.
Limits
These are the same for every account, free or paying:- 5,000 rows and 2 MB per file. Split a larger list into several files.
- 50,000 imported licenses per account per day (UTC). This is separate from the daily limit on generated licenses.
- 10 import requests per account per minute, checks and removals included.
What an import does not do
- No emails. Nothing is sent to your customers or to you. They already have their key.
- No webhooks.
license.createddoes not fire for imported licenses, andlicense.revokeddoes not fire for one that is imported revoked. - No creation dates. An imported license is created at the moment of the import, whatever the old system recorded.
- No changes to licenses you already have. A line whose key is already in the app is skipped whole, its status and variables included. To change existing licenses, use bulk actions or the API.
- No link to a payment provider. Commerce never changes an imported license: a Stripe or Lemon Squeezy renewal, refund, chargeback or add-on purchase does not extend or revoke it, even when its email is the buyer’s. Extend or revoke imported licenses yourself.
- No credits. Importing is free. A license costs a credit when it is validated, like any other.
Change many licenses at once
After a migration you often need to act on thousands of licenses: revoke a batch that was refunded, extend everyone by a month, set a variable on a whole product line. The license list on the app page does that for every license that matches its search and status filter, not only for the 25 on the page.- Narrow the list with the search box and the Status filter, or leave both empty for every license in the app.
- Tick the box in the table’s header. That selects the page.
- Choose Select all N licenses that match the search and filter in the bar that appears.
- Choose the action: Revoke, Reactivate, Extend 30d, Reset HWID, Delete or Set Variables.
- Read the confirmation. It says how many licenses, which ones (the filter and search in words), and how many of them have a device bound. For more than 100 licenses you confirm by typing the number.
- Nothing is rolled back. If part of a run fails, or you stop it, what was done stays done. The licenses that were not done stay selected, so choosing the action again retries exactly those. Download the list gives you each of them with the reason.
- Each license has its own result. A license that was deleted in the meantime, or that the server refused, is counted and listed while the run goes on with the rest.
- Extend is never repeated blindly. If a request to extend gets no answer, those licenses may or may not have their 30 days. They are listed as not confirmed and are not selected for a retry, because a second attempt could add the days twice.
- Webhooks fire for every license, as they do for a single one:
license.revoked,license.activated,license.deletedandlicense.hwid_reset. Revoking 5,000 licenses sends 5,000 events to each webhook that listens for them, and the confirmation says so. Extending and setting variables send none. - Changing the search or the filter drops a selection of “everything that matches”, so you never act on licenses the list is no longer showing.
Device bindings
Most migrations should leavehwids empty. The first time a customer runs your new build, the SDK binds their device to the key, as it does for a new license.
That works because an AuthForge device ID is computed by the AuthForge SDK (see HWID locking); the IDs stored in your old system were computed differently and will not match. Import hwids only if your app sends its own identifier through the SDK’s HWID override, for example an account ID, and the file holds those same identifiers. A line may list at most as many device IDs as it has seats.
If you are worried about a key being shared during the changeover, import it with the right number of seats and no bindings: the first devices to run the new build take the seats, and you can reset a key that was claimed by the wrong device.
Import with the Developer API
POST /v1/licenses/import runs the same import from a script. See the Licenses API reference.
dryRun: true first, read the report, then send the same body with dryRun: false. The answer to a real run carries an importId; POST /v1/licenses/import/remove with that id deletes what the import created.