opengame login gets one by device login: the CLI shows a code, you approve it in your browser, and the CLI trades the approved code for a token. These routes are that exchange, plus revoking a token and reading the account behind one.
Authentication covers each credential, and errors covers the JSON error body.
Start a device login
POST https://opengame.io/api/v1/auth/device
Authentication: None.
RFC 8628 device authorization. Returns a code the person types into the approval page at /cli. The request lives 10 minutes; poll /api/v1/auth/token no faster than interval. Limited to 300 requests per address each 10 minutes.
Body
Sent asapplication/json.
Shown on the approval page and used as the token’s name, for example the machine’s hostname. Trimmed. No control or bidirectional formatting characters, and nothing shaped like a credential. 1 to 60 characters. Example:
studio-macbook.Request
cURL
Response 200
A pending device request.Errors
Exchange an approved device code for a token
POST https://opengame.io/api/v1/auth/token
Authentication: None.
Poll until the person approves. Approval and redemption are single use. The token is returned once and is never shown again; store it in the OS keychain or a file only you can read.
Body
Sent asapplication/json.
Request
Response 200
Approved.Errors
Revoke the calling token
POST https://opengame.io/api/v1/auth/logout
Authentication: A creator token.
A token can revoke itself and nothing else. It works even when the account has lost platform access, and the call is not counted against the token’s allowance. Token administration happens in the browser.
Request
Response 200
Whether a live token was revoked by this call. False only when another request revoked it first.Errors
Rename your handle
POST https://opengame.io/api/v1/account/handle
Authentication: A creator token or a signed-in browser session.
Rename the signed-in account’s handle, as Settings does, through the same function: the same rate limits, the same moderation and the same uniqueness check. The old handle becomes free for anyone to claim at once, the account’s games keep their /g links, and the profile address changes. Only a browser session or the token opengame login makes can do this; a token made in settings cannot, whatever the permissions, and neither can one pinned to a game. What opengame handle sends.
Body
Sent asapplication/json.
Request
Response 200
Renamed.Errors
Read who this credential is for
GET https://opengame.io/api/v1/auth/me
Authentication: A creator token or a signed-in browser session.
Returns the account behind the credential and, for a token, the scopes and game pin.
Request
Response 200
The account and the credential’s scopes.Errors
Check whether OpenGame is open to creators
GET https://opengame.io/api/v1/status
Authentication: Optional: a creator token or a signed-in browser session.
Returns whether OpenGame is open to creators, whether the account behind the credential may use it, and when deploys stop. Any signed-in account may use it, so access is true for one. Deploys stop at entriesCloseAt. Works with no credential. deploysFrozen is true once entries have closed, after which each deploy is rejected with entries_closed. The CLI calls this before each command except version, help, login, logout and whoami, stops with exit code 7 when neither launched nor access is true, and stops deploy when deploysFrozen is true.
Request
cURL