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
| Parameter | Type | Required | Description |
|---|---|---|---|
| token | string | required | The token to introspect |
| client_id | string | required | Your OAuth client ID |
| client_secret | string | required | Your OAuth client secret |
Responses
| Status | Reason | Schema |
|---|---|---|
| 200 | OK | object |
Response fields
| Parameter | Type | Required | Description |
|---|---|---|---|
| active | boolean | required | Whether the token is currently active |
| scope | string | optional | Granted scope (present when active) |
| client_id | string | optional | Client ID the token was issued to (present when active) |
| token_type | string | optional | Token type (present when active) |
| exp | integer | optional | Expiration 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| token | string | required | The token to revoke |
| client_id | string | required | Your OAuth client ID |
| client_secret | string | required | Your OAuth client secret |
Responses
| Status | Reason | Schema |
|---|---|---|
| 200 | OK | No 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| grant_type | string | required | OAuth 2.0 grant type |
| client_id | string | required | Your OAuth client ID |
| client_secret | string | required | Your OAuth client secret |
| scope | string | optional | Requested scope (space-delimited) |
Responses
| Status | Reason | Schema |
|---|---|---|
| 200 | OK | object |
| 401 | Unauthorized | object |
Response fields
| Parameter | Type | Required | Description |
|---|---|---|---|
| access_token | string | required | The issued access token |
| token_type | string | required | Token type (always "Bearer") |
| expires_in | integer | required | Token lifetime in seconds |
| scope | string | optional | Granted scope |
| created_at | integer | required | Token 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
| Status | Reason | Schema |
|---|---|---|
| 200 | OK | object |
| 401 | Unauthorized | No body |
Response fields
| Parameter | Type | Required | Description |
|---|---|---|---|
| resource_owner_id | integer | null | optional | ID of the resource owner (null for client credentials) |
| scope | string[] | optional | Granted scopes |
| expires_in_seconds | integer | null | optional | Seconds until token expiration |
| application | object | optional | |
| application.uid | string | optional | OAuth application client ID |
| created_at | integer | optional | Token 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
}