OAuth API
Developer Reference
API REFERENCE

Token

Issue an access token, check whether one is still active, and revoke it.

POST /oauth/introspect

Introspect token

Determine the active state and metadata of a token per RFC 7662.

Request body

ParameterTypeRequiredDescription
tokenstringrequiredThe token to introspect
client_idstringrequiredYour OAuth client ID
client_secretstringrequiredYour OAuth client secret

Responses

StatusReasonSchema
200OKobject

Response fields

ParameterTypeRequiredDescription
activebooleanrequiredWhether the token is currently active
scopestringoptionalGranted scope (present when active)
client_idstringoptionalClient ID the token was issued to (present when active)
token_typestringoptionalToken type (present when active)
expintegeroptionalExpiration timestamp in Unix epoch (present when active)
Example request
curl -X POST "https://api.betterup.co/oauth/introspect" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode 'token=<token>' \
  --data-urlencode 'client_id=<client_id>' \
  --data-urlencode 'client_secret=<client_secret>'
Example response
{
  "active": true,
  "scope": "<scope>",
  "client_id": "<client_id>",
  "token_type": "Bearer",
  "exp": 0
}
POST /oauth/revoke

Revoke token

Revoke an access or refresh token per RFC 7009. After revocation the token can no longer be used.

Request body

ParameterTypeRequiredDescription
tokenstringrequiredThe token to revoke
client_idstringrequiredYour OAuth client ID
client_secretstringrequiredYour OAuth client secret

Responses

StatusReasonSchema
200OKNo body
Example request
curl -X POST "https://api.betterup.co/oauth/revoke" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode 'token=<token>' \
  --data-urlencode 'client_id=<client_id>' \
  --data-urlencode 'client_secret=<client_secret>'
POST /oauth/token

Request access token

Exchange credentials for an access token. For partner integrations, use the client_credentials grant type with your client ID and secret.

Request body

ParameterTypeRequiredDescription
grant_typestringrequiredOAuth 2.0 grant type
client_idstringrequiredYour OAuth client ID
client_secretstringrequiredYour OAuth client secret
scopestringoptionalRequested scope (space-delimited)

Responses

StatusReasonSchema
200OKobject
401Unauthorizedobject

Response fields

ParameterTypeRequiredDescription
access_tokenstringrequiredThe issued access token
token_typestringrequiredToken type (always "Bearer")
expires_inintegerrequiredToken lifetime in seconds
scopestringoptionalGranted scope
created_atintegerrequiredToken creation timestamp (Unix epoch)
Example request
curl -X POST "https://api.betterup.co/oauth/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode 'grant_type=client_credentials' \
  --data-urlencode 'client_id=<client_id>' \
  --data-urlencode 'client_secret=<client_secret>' \
  --data-urlencode 'scope=api:partner:organizations:read'
Example response
{
  "access_token": "<access_token>",
  "token_type": "Bearer",
  "expires_in": 7200,
  "scope": "api:partner:organizations:read",
  "created_at": 0
}
GET /oauth/token/info

Token info

Returns metadata about the access token used in the request. The token is passed via the Authorization header.

Requires any one of api:partner:organizations:read

Responses

StatusReasonSchema
200OKobject
401UnauthorizedNo body

Response fields

ParameterTypeRequiredDescription
resource_owner_idinteger | nulloptionalID of the resource owner (null for client credentials)
scopestring[]optionalGranted scopes
expires_in_secondsinteger | nulloptionalSeconds until token expiration
applicationobjectoptional
application.uidstringoptionalOAuth application client ID
created_atintegeroptionalToken creation timestamp (Unix epoch)
Example request
curl -X GET "https://api.betterup.co/oauth/token/info" \
  -H "Authorization: Bearer <access_token>"
Example response
{
  "resource_owner_id": 0,
  "scope": [
    "<scope>"
  ],
  "expires_in_seconds": 0,
  "application": {
    "uid": "<uid>"
  },
  "created_at": 0
}