Guides
Guides are per-game wiki pages written in Markdown ("How to install mods for Deadlock", tool guides). Each guide lives in one language (locale = en or ru), has a numeric id, a slug that is unique within the game, and a public revision history. On the site a guide is at /games/{game}/guides/{slug}.
Read
GET /games/{game}/guides?locale=en&limit=20
GET /games/{game}/guides/{slug}
The list returns published guides, newest first, with the usual cursor envelope. GET /games/{game}/guides/{slug} returns the Markdown (body), sanitized HTML (bodyHtml, headings start at h2) and what the caller may do (canEdit, canPublish, canModerate). Drafts and hidden guides are visible only to their author and to editors; everyone else gets 404.
- curl
- TypeScript
- Python
#!/usr/bin/env bash
set -euo pipefail
BASE_URL="${GLITCHMUG_API:-https://api.glitchmug.com/v1}"
# Published guides of a game in one language, newest first
curl -fsS "$BASE_URL/games/deadlock/guides?locale=en&limit=20"
const baseUrl = process.env.GLITCHMUG_API ?? 'https://api.glitchmug.com/v1';
// Published guides of a game in one language, newest first
const res = await fetch(`${baseUrl}/games/deadlock/guides?locale=en&limit=20`);
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const body = (await res.json()) as { data: { id: number; path: string; title: string }[] };
for (const g of body.data) console.log(g.id, g.path, g.title);
import json
import os
import urllib.request
base_url = os.environ.get("GLITCHMUG_API", "https://api.glitchmug.com/v1")
# Published guides of a game in one language, newest first
with urllib.request.urlopen(f"{base_url}/games/deadlock/guides?locale=en&limit=20") as res:
body = json.load(res)
for guide in body["data"]:
print(guide["id"], guide["path"], guide["title"])
Write
POST /games/{game}/guides
PATCH /games/{game}/guides/{slug}
Writing needs an API key with mods:write or a site session.
- Anyone signed in can create a guide (10 a day). It starts as a
draftunless you ask forstatus: "published"and holdguide:publish(trusted authors and moderators). - The author can edit their guide;
guide:edit(game moderators and up) edits any guide. 60 edits an hour. - Changing
statusbetweendraftandpublishedneedsguide:publish. - Every create, edit and revert adds a revision. The
slugis picked from the title at creation and never changes. - Too many requests:
429 guide_rate_limited.
- curl
- TypeScript
- Python
#!/usr/bin/env bash
set -euo pipefail
BASE_URL="${GLITCHMUG_API:-https://api.glitchmug.com/v1}"
# Needs scope mods:write. Without the guide:publish permission the guide starts as a draft.
curl -fsS -X POST "$BASE_URL/games/deadlock/guides" \
-H "Authorization: Bearer $GLITCHMUG_TOKEN" \
-H "Content-Type: application/json" \
-d '{"locale": "en", "title": "How to install mods", "summary": "Folders and tools.", "body": "## Steps\n\n1. Download the mod.", "status": "published"}'
const baseUrl = process.env.GLITCHMUG_API ?? 'https://api.glitchmug.com/v1';
// Needs scope mods:write. Without the guide:publish permission the guide starts as a draft.
const res = await fetch(`${baseUrl}/games/deadlock/guides`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.GLITCHMUG_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
locale: 'en',
title: 'How to install mods',
summary: 'Folders and tools.',
body: '## Steps\n\n1. Download the mod.',
status: 'published',
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const guide = await res.json();
console.log(guide.id, guide.status, guide.path);
import json
import os
import urllib.request
base_url = os.environ.get("GLITCHMUG_API", "https://api.glitchmug.com/v1")
# Needs scope mods:write. Without the guide:publish permission the guide starts as a draft.
req = urllib.request.Request(
f"{base_url}/games/deadlock/guides",
method="POST",
data=json.dumps(
{
"locale": "en",
"title": "How to install mods",
"summary": "Folders and tools.",
"body": "## Steps\n\n1. Download the mod.",
"status": "published",
}
).encode(),
headers={
"Authorization": f"Bearer {os.environ['GLITCHMUG_TOKEN']}",
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(req) as res:
guide = json.load(res)
print(guide["id"], guide["status"], guide["path"])
History
GET /games/{game}/guides/{slug}/revisions
GET /games/{game}/guides/{slug}/revisions/{rev}
POST /games/{game}/guides/{slug}/revisions/{rev}/revert
History is public for visible guides. revert (needs guide:edit) restores the title, summary and text of an older revision as a new revision; nothing is deleted.
Moderation
POST /games/{game}/guides/{slug}/hide takes a rule code (and an optional reason); POST …/unhide shows the guide again. Both need guide:hide in the game and are written to the moderation log.