Loopwise Docs
Reference

Authorization Endpoints

Technical reference for the OAuth 2.0 authorization and discovery endpoints.

Authorization endpoint

GET /oauth/authorize

Initiates the OAuth 2.0 Authorization Code flow. Redirects the user to the Loopwise login and consent screen.

Parameters

ParameterTypeRequiredDescription
response_typestringYesMust be code
client_idstringYesThe application's client ID
redirect_uristringYesMust exactly match a registered redirect URI
scopestringYesSpace-separated list of requested scopes
statestringRecommendedOpaque value to prevent CSRF. Returned unchanged in the callback
code_challengestringYesBase64url-encoded SHA-256 hash of the code_verifier
code_challenge_methodstringYesMust be S256
school_idintegerNoPre-select a school (skips the school picker if valid)

Success response

Redirects to redirect_uri with:

ParameterDescription
codeThe authorization code (single-use, short-lived)
stateThe state value from the request

Error response

Redirects to redirect_uri with:

ParameterDescription
errorError code (e.g., access_denied, invalid_request)
error_descriptionHuman-readable error description
stateThe state value from the request

Discovery endpoint

GET /.well-known/oauth-authorization-server

Returns OAuth 2.0 Authorization Server Metadata per RFC 8414.

Response

{
  "issuer": "https://your-school.loopwise.com",
  "authorization_endpoint": "https://your-school.loopwise.com/oauth/authorize",
  "token_endpoint": "https://your-school.loopwise.com/api/oauth/token",
  "token_endpoint_auth_methods_supported": ["none", "client_secret_post"],
  "revocation_endpoint": "https://your-school.loopwise.com/api/oauth/revoke",
  "registration_endpoint": "https://your-school.loopwise.com/api/oauth/register",
  "response_types_supported": ["code"],
  "grant_types_supported": ["authorization_code", "refresh_token"],
  "code_challenge_methods_supported": ["S256"],
  "scopes_supported": ["read", "write", "courses:read", "..."],
  "service_documentation": "https://docs.loopwise.com",
  "mcp_client_id": "..."
}

Dynamic Client Registration endpoint

POST /api/oauth/register

Registers a new OAuth client per RFC 7591. Known platforms (Claude Code, Cursor, etc.) receive pre-registered credentials.

Request body

FieldTypeRequiredDescription
client_namestringYesHuman-readable name for the client
redirect_urisstring[]NoList of allowed redirect URIs
grant_typesstring[]NoDefaults to ["authorization_code", "refresh_token"]
response_typesstring[]NoDefaults to ["code"]
token_endpoint_auth_methodstringNoDefaults to "none" (public client)

Response

{
  "client_id": "abc123...",
  "client_name": "My Integration",
  "redirect_uris": ["https://myapp.com/callback"],
  "grant_types": ["authorization_code", "refresh_token"],
  "response_types": ["code"],
  "token_endpoint_auth_method": "none",
  "scope": "read write courses:read ..."
}

If the application is confidential, the response also includes client_secret.