When to migrate
PATs and OAuth solve different problems. Migrate when at least one of these is true:Multiple users
Your app is used by more than one Flexslot account. PATs are one-per-user; OAuth lets each user connect their own account.
You don't want to handle credentials
With OAuth, users never share their Flexslot password or token with you. They consent on flexslot.gg.
You need scope-limited access
PATs grant full account access. OAuth tokens are scoped to exactly what you requested.
You need revocation hygiene
OAuth tokens auto-expire (1h access, 30d refresh) and can be revoked per-grant from
/account/connected-apps.Side-by-side
The API call is identical. The difference is how you get the token.Authorization header is the same. Everything underneath — token lifetime, refresh, scope checks — changes.
Migration plan
1
Register an OAuth client
Account → API access → OAuth applications → New application. See Quickstart Step 1.
2
Add a 'Connect Flexslot' button
Sends the user through the OAuth flow (authorization code with PKCE).
3
Store tokens per-user
Add
flexslot_access_token, flexslot_refresh_token, flexslot_expires_at to your user record. Encrypt at rest.4
Pick the token at call time
If the user connected via OAuth, use their access token (refreshing if needed). Otherwise fall back to the PAT.
5
Migrate users gradually
Encourage existing users to reconnect via OAuth. You can keep PAT support indefinitely; this is purely a UX upgrade.
Token selection pattern
A common pattern: a single function that returns “the best available credential” for a given user.What changes for your users
What stays the same
- Endpoints: identical.
GET /api/public/v1/games/magic-the-gathering/decks, etc. - Response shapes: identical.
- Pagination, filtering: identical.
- Webhook signing: not affected — that’s HMAC, separate from auth.
- Rate limits: same per-account limits whether you use PAT or OAuth.
Adding the “Connect” UI
Most apps add a section to their existing settings page:Flexslot Integration ☑ Connected as @usernameThe Connect button sends the user through the OAuth flow. The Disconnect button:
[Disconnect] or ☐ Not connected
[Connect Flexslot]
- Calls
POST /api/public/v1/oauth/revokewith the user’s refresh token - Clears
flexslot_access_token,flexslot_refresh_token,flexslot_expires_atfrom your DB
Common pitfalls when migrating
Should you remove PAT support?
You don’t have to. Some users prefer PATs:- Scripts that don’t have a browser
- CI integrations
- Personal automation
Next steps
Quickstart
Get the first end-to-end flow working
Connected Apps UX
The UI patterns users expect
Scopes
Pick the right minimum-viable set
Errors
Handle revocation and refresh failures