CollectalesDevelopers

Client credentials flow#

Send a form-encoded client_credentials request to /oauth/token with HTTP Basic client authentication. Use the returned token as a Bearer token on protected requests. Tokens are opaque; clients must not decode them.

COLLECTALES_ACCESS_TOKEN=$(curl --fail-with-body --silent --show-error \
  --request POST "$COLLECTALES_BASE_URL/oauth/token" \
  --user "$COLLECTALES_CLIENT_ID:$COLLECTALES_CLIENT_SECRET" \
  --data-urlencode "grant_type=client_credentials" \
  --data-urlencode "scope=catalog:read" | jq -er '.access_token')
ScopeAllows
catalog:readGames, cards, and sets
directories:readDirectory types, entries, and related cards
prices:readCurrent variant-level prices and 7/30-day changes when enabled
prices:historyUp to six calendar months of daily history (Pro or contract; when enabled)
decks:readPublished non-tournament decks
tournaments:readEvents and their tournament deck lists
meta:readSourced leader and archetype representation

Scope and environment boundaries#

A scope grant authorizes a request; it does not prove that a game has enough data for your use case. Read capability availability separately. Sandbox/staging and production credentials must remain separate.

Token failures#

On protected resources, 401 means the token is invalid, expired, or revoked: obtain one fresh token and retry once. A 403 means the token or plan lacks the required scope. At the token endpoint, invalid credentials return 401 invalid_client; a scope outside the application’s grants returns 400 invalid_scope.

Guides and real API endpoints