Skip to content
BuildBase
HTTP API menu

Introspect a refresh token

RFC 7662 token introspection for the refresh tokens the platform issues; access tokens are minted by the app's own server and are not covered.

POST/api/v1/auth/oauth2/introspect

Sign-in
None at the router: the operation is public, or checks its own proof (a signature, a token in the body, a signed link).
Rate limit
Up to 500 requests every 3 seconds per IP address; up to 1,000 requests a minute per API key (some requests are not counted); up to 300 requests a minute per IP address; up to 150 requests a minute per oauthClientLimiterKey.

RFC 7662 token introspection for the refresh tokens the platform issues; access tokens are minted by the app's own server and are not covered. The client authenticates with client_id and client_secret in the body or with HTTP Basic, and a public client by its client_id alone; failed client authentication answers 401 and a missing token answers 400. A token that is unknown, expired, consumed, belongs to another client or whose user is deleted or blocked answers only active: false.

Request

Send the body as application/json or application/x-www-form-urlencoded. The body is optional.

Body

FieldTypeRequiredConstraintsDescription
tokenstring or number or boolean or nullNoat most 4096 characters-
token_type_hintstring or number or boolean or nullNoat most 4096 characters-
client_idstring or number or boolean or nullNoat most 4096 characters-
client_secretstring or number or boolean or nullNoat most 4096 characters-

Example request

Replace each YOUR_... value with your own.

curl -X POST "https://api.console.buildbase.app/api/v1/auth/oauth2/introspect" \
  -H "Content-Type: application/json" \
  -d '{
  "token": "string",
  "token_type_hint": "string",
  "client_id": "YOUR_CLIENT_ID"
}'
const response = await fetch(
  'https://api.console.buildbase.app/api/v1/auth/oauth2/introspect',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      token: 'string',
      token_type_hint: 'string',
      client_id: 'YOUR_CLIENT_ID',
    }),
  }
);
if (!response.ok) {
  throw new Error(`${response.status}: ${await response.text()}`);
}
const data = await response.json();
import requests

response = requests.post(
    "https://api.console.buildbase.app/api/v1/auth/oauth2/introspect",
    json={
        "token": "string",
        "token_type_hint": "string",
        "client_id": "YOUR_CLIENT_ID",
    },
    timeout=30,
)
response.raise_for_status()
data = response.json()

Responses

200 OK

OK

Example
{
  "active": true,
  "client_id": "Onk5TwQjhFIJ86vH7qEcuP4F1iVC6lZRUFz6brd1",
  "exp": 1796972683,
  "iat": 1794380683,
  "iss": "http://localhost:3000/org/000000000000000000000001",
  "sub": "000000000000000000000002"
}

Any other status

Any other answer the handler sends itself (its own refusals). Not described yet.

Errors

Each refusal, what it means, and what to do. The request changed nothing.

400 Bad Request

What it means: The request was refused in the OAuth 2.0 error shape (RFC 6749 section 5.2): error is a code such as invalid_request, invalid_grant, unsupported_grant_type or invalid_scope, and error_description says why in words. Branch on error, never on the description.

What to do: Fix the field the body names in path (or read message) and send the request again. Nothing was changed.

Example
{
  "error": "string",
  "error_description": "string"
}

401 Unauthorized

What it means: Client authentication failed (RFC 6749 section 5.2): error is invalid_client. When the client sent its credentials with HTTP Basic, the answer carries a WWW-Authenticate header.

What to do: Send the credential this operation asks for (see Sign-in above), or sign in again if it expired. A valid credential is also refused when the role has no grant for the permission above.

Example
{
  "error": "string",
  "error_description": "string"
}

429 Too Many Requests

What it means: A rate limit in x-rateLimit was reached. retryAfter and the Retry-After header say how many seconds until the window resets.

What to do: Wait the number of seconds in the Retry-After header (also retryAfter in the body), then retry. Slow down repeated calls.

Example
{
  "success": false,
  "message": "string",
  "reason": "rate_limited",
  "retryAfter": 1
}