For the complete documentation index, see llms.txt. This page is also available as Markdown.

Auth

OAuth 2.1 runtime endpoints (token exchange, revoke, introspect).

Exchange auth code or refresh token for an access token.

post

RFC 6749 token endpoint. Grants: authorization_code (with PKCE) and refresh_token. Refresh tokens rotate on every use β€” the previous refresh_token is invalidated immediately. Request body is application/x-www-form-urlencoded, not JSON. Server-to-server integrations should use API keys, not OAuth.

Body

Form-encoded body per RFC 6749. Two grant types supported:

  • authorization_code with PKCE β€” for interactive auth after a user grants access.
  • refresh_token β€” to exchange a refresh token for a new access token. Refresh tokens rotate on every use; the old refresh token is invalidated.
grant_typestring Β· enumRequiredPossible values:
client_idstringRequired

Your OAuth client's ID.

client_secretstringOptional

Confidential clients only. Public clients (SPAs, native apps) must NOT send this; they authenticate via PKCE.

codestringOptional

Required for authorization_code. The code you received at your redirect_uri.

redirect_uristringOptional

Required for authorization_code. Must match the URI used in the authorization request.

code_verifierstringOptional

Required for authorization_code with PKCE (which is required for all interactive flows). The verifier that produced the code_challenge on the authorization request.

refresh_tokenstringOptional

Required for refresh_token grant.

scopestringOptional

Space-separated scopes to request. On refresh, you may request a subset of the previously granted scopes; you cannot request additional scopes.

Responses
200

New tokens issued.

application/json
access_tokenstringRequired
token_typeconst: BearerRequired
expires_inintegerRequired

Seconds until the access token expires.

refresh_tokenstringOptional

Present on authorization_code grant and every refresh_token grant (rotated).

scopestringOptional

Space-separated actually-granted scopes.

post/oauth/token
POST /v3/oauth/token HTTP/1.1
Host: api.gleantap.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 174

"grant_type='authorization_code'&client_id='text'&client_secret='text'&code='text'&redirect_uri='text'&code_verifier='text'&refresh_token='text'&scope='text'"
{
  "access_token": "text",
  "token_type": "text",
  "expires_in": 1,
  "refresh_token": "text",
  "scope": "text"
}

Revoke an OAuth token.

post

RFC 7009. Revokes either an access token or a refresh token. Revoking a refresh token invalidates all access tokens issued from it. Revoking an access token does NOT invalidate its refresh token.

Body
tokenstringRequired
token_type_hintstring Β· enumOptionalPossible values:
client_idstringOptional
client_secretstringOptional
Responses
200

Revoked (or the token was already invalid β€” the spec requires 200 either way).

No content

post/oauth/revoke
POST /v3/oauth/revoke HTTP/1.1
Host: api.gleantap.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 91

"token='text'&token_type_hint='access_token'&client_id='text'&client_secret='text'"
200

Revoked (or the token was already invalid β€” the spec requires 200 either way).

No content

Introspect an OAuth token.

post

RFC 7662. Check whether a token is currently active and, if so, what it authorizes. Requires client credentials β€” public clients cannot introspect.

Body
tokenstringRequired
token_type_hintstring Β· enumOptionalPossible values:
client_idstringRequired
client_secretstringRequired
Responses
200

Introspection result. active: false means the token is invalid, expired, or revoked.

application/json

Per RFC 7662. active is the only guaranteed field; other fields are present when the token is valid.

activebooleanRequired
scopestringOptional
client_idstringOptional
usernamestringOptional
expintegerOptional

Expiration timestamp (Unix seconds).

iatintegerOptional

Issued-at timestamp.

substringOptional

The subject (user ID) for user-scoped tokens.

audstringOptional
token_typestring Β· enumOptionalPossible values:
post/oauth/introspect
POST /v3/oauth/introspect HTTP/1.1
Host: api.gleantap.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 91

"token='text'&token_type_hint='access_token'&client_id='text'&client_secret='text'"
{
  "active": true,
  "scope": "text",
  "client_id": "text",
  "username": "text",
  "exp": 1,
  "iat": 1,
  "sub": "text",
  "aud": "text",
  "token_type": "access_token"
}