Skip to content
Download all docs .md

Hosting Upload API

The gamefuse command is a thin layer over a small HTTP API. Use it to upload from your own scripts or build server.

An upload has two parts:

  1. Ask the GameFuse API for an upload ticket.
  2. Send the zip straight to the hosting server with that ticket.

Authentication

Every call to https://gamefuse.co/api/v3/hosting sends your game's upload key in a header:

gamefuse-upload-key: mpk_3f9a1c0b7d2e4f6a8b0c1d2e3f4a5b6c

The older header multiplayer-upload-key also works. The game_id you send must be the game the key belongs to.

Errors come back as JSON with plain words:

{ "error": "This game has no hosting plan." }

The calls

All under https://gamefuse.co/api/v3/hosting.

Call Send Answer
POST /api/v3/hosting/uploads game_id, size (bytes), file_count, source (cli) 201 with an upload ticket. See below.
GET /api/v3/hosting game_id 200 with the status
POST /api/v3/hosting/rollback game_id 200 with the status. 422 if there is no previous upload.
DELETE /api/v3/hosting game_id 200 with the status. The slot is emptied.
POST /api/v3/hosting/domain game_id, domain 201 with the domain
GET /api/v3/hosting/domain game_id 200 with the domain, or 404 if none is linked
POST /api/v3/hosting/domain/check game_id 200 with the domain, after a fresh DNS check
DELETE /api/v3/hosting/domain game_id 200 {"removed": true}

Asking for an upload ticket

curl -X POST https://gamefuse.co/api/v3/hosting/uploads \
  -H "gamefuse-upload-key: $GAMEFUSE_UPLOAD_KEY" \
  -d game_id=123 -d size=4200000 -d file_count=31 -d source=cli
{
  "upload_id": 8,
  "ticket": "eyJ1cGxvYWRfaWQiOjh9.c2lnbmF0dXJl",
  "upload_url": "https://hosting.gamefuse.co/_gamefuse/upload",
  "expires_at": "2026-11-30T12:10:00Z",
  "limits": { "max_bytes": 104857600, "max_file_bytes": 26214400, "max_files": 2000 },
  "url": "https://produce-conflict.gamefuse.co"
}

The ticket lasts 10 minutes and works for one upload.

Status Meaning
402 The game has no hosting plan.
403 The game was taken down by GameFuse.
413 size is over max_bytes, or file_count is over max_files.
429 The game has had 20 uploads today.

Sending the zip

POST the zip to the upload_url from the ticket answer:

POST https://hosting.gamefuse.co/_gamefuse/upload
x-gamefuse-ticket: <ticket>
content-type: application/zip

The body is the zip itself. index.html must be at the top of the zip.

(cd dist && zip -qr ../game.zip .)
curl -X POST "$UPLOAD_URL" \
  -H "x-gamefuse-ticket: $TICKET" \
  -H "content-type: application/zip" \
  --data-binary @game.zip

The server unzips it, runs the file checks, and makes it live in one step.

On success, 201:

{
  "url": "https://produce-conflict.gamefuse.co",
  "upload": { "id": 8, "size": 4200000, "file_count": 31 },
  "warnings": [".map files found: they show your source code to anyone who looks."]
}

When a check fails, 422. Nothing that was live changes:

{
  "error": "The upload did not pass the checks.",
  "problems": ["index.html is missing at the top of the zip"]
}
Status Meaning
401 The ticket is badly formed, wrongly signed or expired. Ask for a new one.
413 The zip passed max_bytes. The server stops reading at once. The zip's own size counts too.
422 A file check failed. See problems.

The upload endpoint accepts requests from any origin (CORS), so a browser page can send the zip. The ticket is the permission.

The status

GET /api/v3/hosting and the other calls answer with:

{
  "game_id": 123,
  "slug": "produce-conflict",
  "url": "https://produce-conflict.gamefuse.co",
  "enabled": true,
  "state": "live",
  "plan": { "key": "basic", "name": "Basic", "admin": false },
  "limits": { "max_bytes": 104857600, "max_file_bytes": 26214400, "max_files": 2000, "monthly_bytes": 10737418240 },
  "live_upload": { "id": 8, "size": 4200000, "file_count": 31, "source": "cli", "created_at": "2026-11-30T12:01:00Z" },
  "previous_upload": { "id": 7, "size": 4100000, "file_count": 30, "source": "browser", "created_at": "2026-11-29T18:20:00Z" },
  "hits": { "today": 40, "last_30_days": 900, "all_time": 2000 },
  "domain": null
}
Field Meaning
state live (players see the game), empty (nothing uploaded), off (hosting switched off) or taken_down (removed by GameFuse).
limits Bytes: game size, one file, and player downloads a month. max_files is a count.
previous_upload The upload rollback would make live, or null.
hits See Hits.
domain Your own domain (below), or null.

The domain

{
  "domain": "play.producegame.com",
  "status": "waiting",
  "message": "The CNAME record for play was not found yet.",
  "last_checked_at": "2026-11-30T12:05:00Z",
  "records": [
    { "type": "TXT", "name": "_gamefuse.play", "host": "_gamefuse.play.producegame.com", "value": "gamefuse-verify=...", "found": false },
    { "type": "CNAME", "name": "play", "host": "play.producegame.com", "value": "hosting.gamefuse.co", "found": false }
  ]
}

status is one of waiting, verifying, live, problem or disconnected. See Use Your Own Domain.