Skip to content

OAuth API โ€‹

Get App โ€‹

prolog
GET API_BASE/apps/:app_id

Parameters โ€‹

ParameterTypeDescription
app_idstringThe app ID.

Response โ€‹

json
{
  "data": AppObject,
  "ts": 1723923923
}

Authorize โ€‹

prolog
GET API_BASE/oauth/authorize?client_id=:client_id&redirect_uri=:redirect_uri&scope=:scope&state=:state&code_challenge=:code_challenge&code_challenge_method=:method&json=:json

Authorization Required โ€‹

OAuthAPIKey
YesYes

Query Parameters โ€‹

ParameterTypeDescription
client_idstringOAuth client ID.
redirect_uristringRedirect URI (must match app config).
scopestringOAuth scope (e.g. user.public, post.write, credit.read).
statestringOAuth state value.
code_challengestringPKCE challenge.
code_challenge_methodstringS256 or plain (default: S256).
jsonstringtrue to return JSON instead of redirect.

Response โ€‹

  • Redirects to redirect_uri with code and state by default.
  • When json=true, returns:
json
{
  "data": {
    "client_id": "app_id",
    "redirect_uri": "https://...",
    "url": "https://...",
    "code": "...",
    "state": "..."
  },
  "ts": 1723923923
}

Scopes โ€‹

ScopeDescription
user.publicRead basic profile information for the user.
user.fullRead full profile information for the user.
post.writeRead and manage posts and related content.
credit.readRead credit balance and credit ledger entries.
credit.fullRead credit balance and ledger, and consume credit.
apikey.readRead API keys and verify API key hashes.

Token โ€‹

prolog
POST API_BASE/oauth/token

Request Body (Form) โ€‹

text
grant_type=authorization_code
client_id=...
redirect_uri=...
code=...
code_verifier=...

For refresh:

text
grant_type=refresh_token
client_id=...
refresh_token=...

Response โ€‹

Returns raw JSON (no wrapper):

json
{
  "access_token": "...",
  "token_type": "Bearer",
  "refresh_token": "...",
  "expires_in": 2592000,
  "expiry": "2025-04-19T00:00:00Z"
}

UserInfo โ€‹

prolog
GET API_BASE/oauth/userinfo

Authorization Required โ€‹

OAuthAPIKey
YesNo

Response โ€‹

Returns raw JSON (no wrapper), in which sub is the pairwise OAuth user ID for the app and uuid is the user's global UUID. Email fields are present only when available.

json
{
  "sub": "...",
  "uuid": "...",
  "name": "User Name",
  "picture": "https://...",
  "email": "user@example.com",
  "email_verified": true
}

Revoke App โ€‹

prolog
DELETE API_BASE/oauth/apps/:app_id

Authorization Required โ€‹

OAuthAPIKey
YesYes

Response โ€‹

json
{
  "data": null,
  "ts": 1723923923
}