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.
matchId: 1–128 characters ofA–Z a–z 0–9 _ . : -slot: 1–64 characters ofA–Z a–z 0–9 _ -- Bodies must be valid JSON, up to 256 KB each.
- Saving to the same match and slot again makes a new version; previous versions are kept up to your plan's history limit.
Save and load
| Method | Path | Does |
|---|---|---|
| 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
| Method | Path | Does |
|---|---|---|
| GET | /v1/matches?limit=50 | Recent 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/usage | Storage used against your plan. |
Version history
| Method | Path | Does |
|---|---|---|
| GET | /v1/matches/{matchId}/{slot}/versions | Current 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
| Code | Meaning |
|---|---|
| 400 | Bad match ID, slot or JSON. |
| 401 | Missing, wrong or revoked key. |
| 404 | Nothing there. |
| 413 | Document too large. |
| 429 | Too many requests — wait for Retry-After seconds. |
| 507 | Storage 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.