OAuth 2.0 token endpoint (RFC 6749). Supports three grants:
authorization_code— exchange a code obtained from the browserGET /oauth/authorizeflow (PKCEcode_verifierrequired). Returns an access token and a rotating refresh token.client_credentials— machine-to-machine token for a marketplace application. Withlocation_idit is an installation token: the installation is resolved from the authenticated OAuth client plus that Location and must beactive. Withoutlocation_idit is an application token: no scopes, only the application's own/marketplace_apps/{marketplace_app_id}/installationsroutes. No refresh token is returned.refresh_token— rotate a refresh token from the Authorization Code flow. The previous refresh token is invalidated; replaying it revokes the token family. The new access token never exceeds the scopes of the original consent:scopemay narrow it, unknown codes are ignored, andinvalid_scopeis returned when every known scope inscopeis outside the consent (the refresh token is not rotated then). The same rule applies toscopeon the code exchange. A refresh token lives 30 days from its issue, the family 90 days from the code exchange; after that the user approves access again.
Confidential clients authenticate with HTTP Basic (client_secret_basic) or send client_id and client_secret in the form body (client_secret_post); public clients (PKCE-only) send their client_id in the form body. There is no password grant.
Errors from this endpoint use the standard OAuth 2.0 error object ({"error": "...", "error_description": "..."}), not application/problem+json.
Token request (RFC 6749, form-encoded). resource selects REST vs MCP token audience (RFC 8707).
Optional (OAuth 2.1 §10.2): PKCE already binds the code to the client. If sent, it must equal the redirect_uri of the authorization request byte for byte.
RFC 8707 resource indicator: https://api.alteg.io/api/v3 or an Altegio MCP address under https://mcp.alteg.io/pro (an address ending in /readonly caps the scopes at read-only). Compared case-insensitively on scheme and host and without a trailing slash. Every accepted address yields the same audience https://api.alteg.io/api/v3; on code exchange it must equal the resource of the authorization request.
- Mock serverhttps://developer.alteg.io/_mock/en/b2b-v3/openapi/oauth/token
- Preview authorization server - endpoint surface is not live yethttps://api.alteg.io/oauth/token
curl -i -X POST \
https://developer.alteg.io/_mock/en/b2b-v3/openapi/oauth/token \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode grant_type=client_credentials \
--data-urlencode location_id=90211 \
--data-urlencode 'scope=appointments:read appointments:create clients:read'Token issued.
{ "access_token": "ag_at_7f3a1c9e0b2d4f68a1c9e0b2", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "ag_rt_5b8e2d4f68a1c9e0b2d4f68a", "scope": "appointments:read appointments:create clients:read" }