Modpack author API: activation codes and updates
How a paid modpack author can issue activation codes and publish updates via the Millida Hosting API: modpack versions, archive upload, publication, rollback, code status, and webhook.
Updated September 6, 2026
You don't have to write code. Everything described below is now available as buttons too: if your modpack is linked to your Millida account, a “My modpacks” tab appears in your profile — there you upload versions, edit the card and build landing pages. Not linked — write to us and we'll link it. The API is for those who deploy from their own CI.
This article is for authors of paid modpacks who sell them themselves and hand the server installation over to us. The buyer doesn't have to download anything: they enter a code and get a deployed modpack. To see what it looks like from their side, read Paid modpack via activation code.
What you need to get started
- Send us the server archive of your modpack — a
.zipwithmods/in the root (without a wrapper likeServer Files/) or a.mrpack. The archive is stored in our private storage, and the link is never shared externally. - Tell us the core, game version and minimum memory — the wizard uses them to filter out plans the modpack won't run on.
- Get a modpack key (
key, for examplearcania) and an issuing token from us — your site uses it to generate codes.
The token is shown only once: we store only its fingerprint. If you lose it, ask us to reissue it — the old one will stop working.
How the scheme works
- You accept payment yourself, on your side.
- After payment, your site calls our API and gets an activation code.
- You give the code to the buyer — by email, bot, or on the “thank you” page.
- The buyer enters the code on our side and gets a server with the modpack on a paid plan.
- The modpack files on the server are locked down:
modscan't be downloaded from the control panel or over SFTP.
Physically, the buyer never gets the server modpack in their hands — only a working server.
Endpoint and authorization
Base URL — https://millida.net/v2/hosting.
The token is passed in the X-Pack-Token header. It's not a JWT or a Bearer token — it's a separate secret for your modpack.
X-Pack-Token: mpk_pack_XXXXXXXXXXXXXXXX
Content-Type: application/json
The token lives on your server — keep it in environment variables, not in frontend code.
Issue codes
POST /v2/hosting/packs/{key}/keys
| Field | Type | Default | What it does |
|---|---|---|---|
count | number 1–200 | 1 | How many codes to generate per call |
note | string up to 120 | — | Your note: order number, buyer's nickname |
maxServers | number 1–20 | 1 | How many servers one code can be activated on |
expiresAt | ISO date | — | Code expiry date |
curl -X POST https://millida.net/v2/hosting/packs/arcania/keys \
-H "X-Pack-Token: $PACK_TOKEN" \
-H "Content-Type: application/json" \
-d '{"count": 1, "note": "order 4821"}'
{
"code": "A7K2-9MHD-4RTP-QW38",
"codes": ["A7K2-9MHD-4RTP-QW38"]
}
The code field is the first code in the batch, kept for compatibility; when count > 1, use codes.
Codes are returned only here and nowhere else. We store their hash — like a password. If you lose a code, we can't recover it: issue a new one and revoke the old one.
The limit is 30 requests per minute per modpack. Batches of up to 200 codes per call exist specifically for sales: generate them in bulk rather than one code per request.
What happened to the codes
GET /v2/hosting/packs/{key}/keys?limit=100
[
{
"codeHint": "A7K29MHD",
"note": "order 4821",
"maxServers": 1,
"usedCount": 1,
"state": "spent",
"expiresAt": null,
"revokedAt": null,
"createdAt": "2026-08-03T12:20:11.000Z"
}
]
The codes themselves aren't in the response and can't be. codeHint is the beginning of the code — use it to match the row to your order.
States: free — unused, spent — used, expired — expired, revoked — revoked by you.
Check a single code
POST /v2/hosting/packs/{key}/keys/status, body {"code": "A7K2-9MHD-4RTP-QW38"}.
The response is the same row as in the list. The code goes in the body, not in the URL: URLs end up in proxy logs and browser history, and before activation the code is a working key.
Hyphens and case don't matter: a7k29mhd4rtpqw38 will be found just like A7K2-9MHD-4RTP-QW38.
Revoke a code
POST /v2/hosting/packs/{key}/keys/revoke, body {"code": "..."}.
Use it for refunds, mistaken issues or disputes. Revoking blocks future activations but doesn't remove an already deployed modpack — a buyer who activated it keeps a working server.
Activation webhook
If you give us a webhook URL, we'll call it the moment a code is redeemed:
POST <your-address>
X-Millida-Pack: arcania
Content-Type: application/json
{
"event": "pack.activated",
"packKey": "arcania",
"codeHint": "A7K29MHD",
"serverId": "cm4x...",
"activatedAt": "2026-08-04T09:14:02.000Z"
}
The call isn't signed: you can verify it with the same token via keys/status — using codeHint you'll find your row and see state: "spent". That way you don't have to store a second secret.
The webhook is sent without waiting for a response and isn't retried: if your server was down, the activation still went through, and you can see it in the code list. The URL must be public — we don't call internal or local addresses. Redirects aren't followed.
Modpack card
GET /v2/hosting/packs/{key} is public, no token needed. It returns what the buyer sees: name, core, version, minimum memory, plan list and protection flags. There's no archive link in the response.
Handy for the “Buy” page on your site: plan requirements come from a single source and won't diverge from what our wizard says.
You edit the storefront fields of your card yourself: PATCH /v2/hosting/packs/{key} with the token accepts name, authorName, authorUrl, iconUrl, webhookUrl. The sale terms (paidOnly, requireKey, lockFiles, planCodes), enabling the modpack in the storefront and JVM launch flags can't be changed with the token — those are our agreement with you and our nodes, so write to us about them.
Modpack updates
Previously an update meant emailing us and waiting. Now you publish a version yourself, and server owners choose it in their control panel.
The key point: we never update anyone silently. Moving between modpack versions can be incompatible with the world, and the server owner makes the decision. The published version is what new servers get and what we offer to already deployed ones; previous versions stay in the list, and you can stay on them or roll back.
What the cycle looks like
# 1. Create a version
curl -X POST https://millida.net/v2/hosting/packs/arcania/versions \
-H "X-Pack-Token: $PACK_TOKEN" -H "Content-Type: application/json" \
-d '{"label":"1.5.0","changelog":"Updated Create to 0.5.1, fixes crash on portals","minRamMb":10240}'
# 2. Upload the archive in chunks (32 MB each), addressing by offset
curl -X POST "https://millida.net/v2/hosting/packs/arcania/versions/1.5.0/archive?offset=0" \
-H "X-Pack-Token: $PACK_TOKEN" -H "Content-Type: application/octet-stream" \
--data-binary @part0.bin
# 3. Say the archive is finished, and publish after parsing
curl -X POST https://millida.net/v2/hosting/packs/arcania/versions/1.5.0/finish \
-H "X-Pack-Token: $PACK_TOKEN" -H "Content-Type: application/json" \
-d '{"archiveSha256":"<sha256 of archive>","publish":true}'
# 4. Wait for parsing
curl https://millida.net/v2/hosting/packs/arcania/versions/1.5.0 -H "X-Pack-Token: $PACK_TOKEN"
Version
| Field | Type | What it does |
|---|---|---|
label | string up to 40 | Version number: Latin letters, digits, dot, hyphen, underscore. Immutable: the same label with different files turns complaint investigation into guesswork |
changelog | string up to 4000 | What changed — the server owner reads this before updating |
core, gameVersion | strings | If the server setup moved to a different core or game version |
loaderBuild, javaVersion | strings | Pin for the loader build and Java, if the version needs it |
minRamMb | number | Memory floor for this specific version. Anyone who doesn't have enough will see the reason and won't lose their world |
archiveSha256 | hex 64 | We verify before parsing: it's better to reject an archive that didn't arrive fully than to unpack it halfway |
Upload
POST /v2/hosting/packs/{key}/versions/{label}/archive?offset=N, body — a chunk of .zip, Content-Type: application/octet-stream. Chunk up to 32 MB, whole archive up to 4 GB.
A chunk is addressed by offset, not “append to the end”: a chunk interrupted midway has already partially landed in the file, and a retry would append the same bytes a second time — the archive would arrive silently corrupted. The response returns uploadedBytes, which is used to resume the upload after an interruption.
Parsing
POST .../finish responds immediately (status: "processing"), while parsing runs in the background: unpacking a gigabyte-sized server setup takes minutes. Read the state from GET .../versions/{label}: processing → ready or failed with the reason text in error.
What the archive must pass:
- it's a server pack: after removing the single wrapper (
Server Files/and similar),mods/orplugins/is at the root. A client pack on a server produces an empty world, so we reject it instead of installing it; - no
.., absolute paths, or Windows separators in names inside the archive; - no password, no exotic compression methods (only store and deflate);
- limits: 60,000 files, 12 GB unpacked, compression ratio up to 200×.
A failure does not affect the published version: your clients keep running the previous one, and you upload again. Unfinished drafts: no more than three per server setup, abandoned ones are cleaned up automatically after a day.
Publishing, rollback, and removal
| Request | What it does |
|---|---|
POST .../versions/{label}/publish | Make the version published. This is also how rollback is done: publish the previous one — new servers get it again |
POST .../versions/{label}/archive-version | Remove the version from selection. Those who already have it keep it |
PATCH .../versions/{label} | Edit the description of an already created version: changelog and minRamMb. Version files are immutable, so the core, loader, and Java don't change |
DELETE .../versions/{label} | Delete the version along with its files. You can't delete a published version or one that's on at least one server |
GET .../versions | Versions available for selection (public, no token) |
GET .../versions/all | Everything of yours, including drafts and failures |
GET .../versions/rollout | How many servers are on which version — you can see how the update is rolling out |
Publishing transfers the core, game version, loader pin, Java, and the version's memory floor into the server setup card: new servers get it without any extra action on your part.
What the server owner sees
In the control panel, in the premium server setup block: which version is installed, which one has been released, your changelog, and a list of versions with a “Switch” button. The update does not affect the world — only the server setup files are replaced, and we take a copy before replacement. Custom mods, if you allowed them, will have to be added again after switching: the server setup moves as a single whole, and half of the old version in mods/ means a crash on startup.
If the owner's plan can't handle a version, we show it with the reason instead of hiding it: the person should see what they need, not guess why the server setup isn't updating.
Your own server setup page
You build the landing page for your server setup yourself in your account (profile → “My server setups” → “Server setup pages”): the first screen, features, screenshots, Q&A, your colors. Plans and the version list are populated with our data so they don't go stale.
The finished page lives at millida.net/sborka/<your-address> — a regular website page, indexed by search engines and included in our sitemap. The draft is visible to no one but you.
Images are uploaded in the same place, in your account: the page is served from our domain, and its files are stored with us — if your hosting goes down, the page stays intact.
Pages can't be edited via the API: it's a screen, not a rollout.
Response codes
| Code | When | What to do |
|---|---|---|
403 | Invalid issuance token | Check X-Pack-Token. The token is tied to one server setup: it doesn't work with someone else's key |
404 | The server setup is disabled, not connected to issuance, or no such version exists | Write to us |
400 | The expiresAt date can't be parsed, bad version label, empty or too large chunk | See the error text |
409 | The version is already created, already parsed, published, or installed on servers | Labels are immutable: release the next one |
429 | More than 30 requests per minute (upload — 600) | Send in batches, and send larger chunks |
How to test everything before selling
Ask us for a couple of test codes: issue a code via the API, activate it on your server on our hosting, see what arrived in the webhook and what keys/status shows. That way you'll see the buyer's entire path before the first paying customer goes through it.
