{"service":"mtg-api","endpoints":{"GET /schema":"tables, views, columns, row counts","GET /query":"?sql=SELECT+...&fmt=rows|objects|tsv&limit=5000 (read-only)","POST /query":"{\"sql\":\"SELECT ...\",\"params\":[],\"fmt\":\"rows|objects|tsv\",\"limit\":5000} (read-only)","GET /auth/google":"start signing in with Google","POST /auth/google/token":"a Google ID token in, a session out — for the phone","GET /auth/callback/google":"where Google sends you back","POST /admin/sql":"arbitrary SQL, for the server operator and the nightly job","GET /c/:key":"whose collection that address names","GET /auth/me":"the signed-in account, or nulls","POST /auth/logout":"end this session","POST /cards/add":"{\"list\":\"4 Lightning Bolt (2X2) 117\",\"dry_run\":false} — into your own collection; \"collection\":\"<key>\" names another you may edit","POST /cards/remove":"{\"list\":\"1 Sol Ring\",\"dry_run\":false} — \"collection\" as for add","POST /decks/disassemble":"{\"key\":\"...\",\"dry_run\":false} — deletes the deck, its cards go back to bulk; needs admin","POST /cards/validate":"{\"list\":\"1 Sol Ring\\n...\"} or {\"names\":[...]} -> which names are real, with suggestions","GET /decks/formats":"the deck formats the wizard offers","POST /decks/create":"{\"name\":\"...\",\"format\":\"commander\",\"commander\":\"...\",\"list\":\"...\"} — in your own collection, or \"collection\":\"<key>\"; answers with the new deck's key","POST /decks/rename":"{\"key\":\"...\",\"name\":\"New name\"} — renames the deck; its key, and so its address, never changes","POST /decks/list":"{\"key\":\"...\",\"list\":\"1 Sol Ring\\n...\",\"dry_run\":false} — replaces the deck list","POST /share":"a share-target body in, what the server actually received back out","POST /prices":"{\"ids\":[\"<scryfall id>\",...]} -> {\"prices\":{id:{usd,foil,etched,eur,tix,tcg}}}","POST /admin":"{\"password\":\"...\"} -> {\"token\":\"...\",\"expires_at\":null}","GET /admin/users":"every account, its role and the key its collection is shared by — admin only","POST /admin/role":"{\"key\":\"...\",\"role\":\"user|admin\"} — hands the admin role out or takes it back; admin only","POST /admin/users/delete":"{\"key\":\"...\"} — deletes that account and everything it owns, nobody else's; admin only, never your own","POST /tasks":"{\"title\":\"...\",\"details\":\"...\",\"files\":[{\"name\",\"type\",\"data\":\"<base64>\"}]} — a new task for the intake; admin only","GET /tasks/inbox":"the tasks the laptop has not collected yet, files included; admin only","POST /tasks/inbox/received":"{\"keys\":[\"...\"],\"names\":{\"<key>\":\"<request file>\"}} — the laptop has written these; admin only","GET /tasks":"every task, newest first, with its status; admin only","POST /tasks/status":"{\"key\" or \"name\",\"status\",\"note\"?,\"title\"?,\"pr\"?,\"started_at\"?,\"finished_at\"?,\"details\"?} — one transition, written by whoever caused it; the times only fill a task that never had a start; details is the request file, kept only for a task with none; admin only","GET /tasks/:key":"one task, its details, status and files, collected or not, and for a done one the writeup its builder filed in summaries/, or else its release note, as summary; admin only","GET /releases":"GitHub's release list, kept by the Worker for a few minutes","GET /rules":"the Comprehensive Rules as Wizards publishes them, text/plain, untouched; the apps parse it","GET /edhrec/commander":"?name=Teysa Karlov -> {\"name\",\"slug\",\"rank\":58,\"decks\":21728} — rank among commanders as EDHREC's commander page says it; null when EDHREC has no page","GET /logs":"?min=info&q=&event=&status=error&since=24&limit=100 — admin only","POST /logs/client":"{\"level\":\"info\",\"message\":\"...\",\"detail\":{...}} — admin only","GET /logs/stats":"counts, slowest routes, retention — admin only","POST /devices":"{\"token\",\"platform\":\"android\",\"label\"?} — where to push to; said by the app on every start, keyed on the token","DELETE /devices":"{\"token\"} — stop pushing to a device","GET /devices":"which devices are registered, with the tokens shortened; admin only","GET /fetch-lists":"your saved Fetch lists, the same on every device; signed in, or the admin token with ?user=<id>","POST /fetch-lists":"{\"lists\":[...]} — replace your saved Fetch lists with these; signed in, or the admin token with \"user\":<id>","GET /maintenance":"what the daily job did last","POST /maintenance":"run it now — needs admin; {\"only\":\"orphans\"} or {\"all\":true,\"wait\":true}","GET /s":"/s/<route> — a shared link: Open Graph tags for that deck, card or collection, then on to the site","GET /.well-known/assetlinks.json":"lets Android open /s/ links in the app"},"auth":"Reads are open. Writes need Authorization: Bearer <token> from POST /admin."}