Start the authorization-code flow (PKCE S256 required)
const url = 'https://api.harperharbor.com/oauth/authorize?response_type=code&client_id=example&redirect_uri=https%3A%2F%2Fexample.com&code_challenge=example&code_challenge_method=S256&resource=%3CAPI_BASE%3E%2Fopen%2Fv1&scope=mcp%3Acard-writer';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.harperharbor.com/oauth/authorize?response_type=code&client_id=example&redirect_uri=https%3A%2F%2Fexample.com&code_challenge=example&code_challenge_method=S256&resource=%3CAPI_BASE%3E%2Fopen%2Fv1&scope=mcp%3Acard-writer'Validates the request, stores it for 10 minutes and redirects (302) the browser to the HarperHarbor login/consent page (the provider’s Console with oauth_request=<id>. After the user logs in and approves/denies (the consent page uses the internal endpoints POST /oauth/authorize/context and POST /oauth/authorize/complete, which require a HarperHarbor Console session and are not part of the client-facing contract), the browser is redirected to redirect_uri with code and state (approve), or error=access_denied and state (deny), or error=temporarily_unavailable if the request expired. The authorization code is valid for 10 minutes and single-use. Validation failures of this endpoint itself are returned as 400 JSON, not as an error redirect.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”From /oauth/register.
Must exactly match one registered redirect URI.
PKCE challenge: base64url(SHA-256(code_verifier)), no padding.
Resource indicator (RFC 8707). Use <API_BASE>/open/v1 for the Open API; the token is only valid on that resource.
Only the single scope exists; omit or send exactly this value.
Opaque value echoed back on the redirect.
Send pro to use the alternate login domain (for regions where the main domain is blocked). Any other value is ignored.
Responses
Section titled “Responses”Redirect to the login/consent page. Later the user agent is redirected to redirect_uri?code=...&state=... or redirect_uri?error=access_denied&state=....
unsupported_response_type, invalid_client, invalid_redirect_uri, unsupported_pkce, invalid_scope, invalid_resource.
object
OAuth error code.
Only on the internal consent endpoints when the request expired.
Seconds to wait before trying again; only with rate_limited.
Examplegenerated
{ "error": "example", "redirect_url": "example", "retry_after": 1}