Skip to main content

Authentication & API keys

Public reads work without credentials. Everything else needs a personal API key, sent as a bearer token.

API keys​

  • Format: gm_<prefix>_<secret>. The prefix (gm_a1b2c3d4) is shown in the list so you can tell keys apart.
  • Create, rotate and revoke keys in Settings → API keys on the website. Keys can't manage keys: those endpoints refuse bearer tokens.
  • The secret is shown once. Only its hash is stored, so a lost key can't be recovered: rotate it.
  • Up to 10 active keys per account, optionally with an expiry (30, 90 or 365 days).
  • A key acts as you, with your roles and permissions, narrowed by its scopes.
Authorization: Bearer gm_a1b2c3d4_Q2hhbmdlTWVJbkEuZW52RmlsZU5vdEluQ29kZTEy
#!/usr/bin/env bash
set -euo pipefail
BASE_URL="${GLITCHMUG_API:-https://api.glitchmug.com/v1}"

curl -fsS "$BASE_URL/me" \
-H "Authorization: Bearer $GLITCHMUG_TOKEN"

Requests with a bearer token don't need cookies or CSRF tokens.

Scopes​

GET requests need only mods:read, which every key has. Writes need the scope of the area:

ScopeGrants
mods:readRead everything you can see on the site (always included)
mods:writeCreate and edit your mods and versions, submit them
files:uploadUpload files and images
comments:writePost, edit and delete comments
webhooks:manageManage your webhooks — needed even to list them

Other writes (likes, collections, reports, settings) are website-only for now.

Failures​

StatuscodeMeaning
401invalid_api_keyMalformed, revoked or expired key
401unauthenticatedNo credentials on an endpoint that needs them
403scope_missingThe key lacks the scope for this request
403bannedThe account is banned; its keys stop working
403forbiddenYou don't have the permission (a key never adds permissions)

See Errors for the response format.