API docs

Base URL https://api.dorage.co.uk · every /v1 call needs Authorization: Bearer <key>. Create keys on your dashboard.

Concepts

You store JSON documents. Each one is addressed by a match ID and a slot — for example match m-0042, slots start and end. Both are names you choose.

Save and load

MethodPathDoes
PUT/v1/matches/{matchId}/{slot}Store JSON. 201 when new, 200 when it replaced a version.
GET/v1/matches/{matchId}/{slot}Return the current JSON exactly as stored.
DELETE/v1/matches/{matchId}/{slot}Delete a slot and its history.
curl -X PUT https://api.dorage.co.uk/v1/matches/m-0042/start \
  -H "Authorization: Bearer $DORAGE_KEY" -H "Content-Type: application/json" \
  -d '{"map":"forest","players":4}'
→ {"match_id":"m-0042","slot":"start","size":28,"created":true,"version":1}

Browse

MethodPathDoes
GET/v1/matches?limit=50Recent matches, newest first. Page with before=<next_before>.
GET/v1/matches/{matchId}Slots in a match, with sizes, versions and history counts.
DELETE/v1/matches/{matchId}Delete a whole match and its history.
GET/v1/usageStorage used against your plan.

Version history

MethodPathDoes
GET/v1/matches/{matchId}/{slot}/versionsCurrent version number and the kept history.
GET/v1/matches/{matchId}/{slot}/versions/{n}Fetch version n.
POST/v1/matches/{matchId}/{slot}/revert/{n}Make version n current again. The replaced version goes into history, so a revert can be undone.

Version numbers only go up, so n always means the same save.

Errors

CodeMeaning
400Bad match ID, slot or JSON.
401Missing, wrong or revoked key.
404Nothing there.
413Document too large.
429Too many requests — wait for Retry-After seconds.
507Storage limit reached.

Every error body is {"error":"code","message":"…"}.

Unity

Download DorageClient.cs into your server project. It retries with backoff and, if every attempt fails, writes the JSON to a local file and the log so nothing is silently lost. Set DORAGE_URL=https://api.dorage.co.uk and DORAGE_KEY as environment variables on your server.

StartCoroutine(DorageClient.Save(matchId, "start", JsonUtility.ToJson(startState)));

// at match end: wait for the save before the server shuts down
yield return DorageClient.Save(matchId, "end", json, ok => saved = ok);
Application.Quit();

StartCoroutine(DorageClient.Load(matchId, "start", (ok, json) => { … }));
StartCoroutine(DorageClient.Revert(matchId, "start", 3));

Keep your key secret

Use keys from your server, not from game clients — anything shipped to players can be extracted. If a key leaks, revoke it on your dashboard and create another.