How it works
Highseat supports the authorization code flow with PKCE, usingS256. Your app runs as a public client, so it holds no secret.
The authorization server publishes its endpoints at:
Discovery document
Identify your app
Pick one of these:- A Client ID Metadata Document. Host a JSON document on your own domain and use its URL as your
client_id. The document holdsclient_id,client_nameandredirect_uris. Theclient_idmust equal the document’s URL, and the picker shows your domain to the person connecting. - Dynamic client registration. Send your
client_nameandredirect_uristo the register endpoint, and use theclient_idit answers with. A client nobody connects within a day is deleted.
redirect_uri you send must match a registered one exactly, query string included.
Ask for access
Send the person to the authorize endpoint:Authorization request
readis required. The person decides on the consent page whether your app reads or also makes changes, so there is no scope for writing.offline_accessreturns a refresh token, which keeps your app connected after the access token expires.resourceis optional. It defaults tohttps://api.highseat.com/v1.
redirect_uri receives a code. Exchange the code at the token endpoint with grant_type=authorization_code, the code, the redirect_uri, your client_id and the code_verifier.
Call the API
Send the access token as a bearer token, as you would an API key. It reaches the workspace and sites the person picked, and every route and limit applies as it does to a key. The budget is counted per connection.highseat package has a typed client. Pass a function as token so each call uses the current access token:
Keep a connection alive
An access token lasts one hour. Send the refresh token to the token endpoint withgrant_type=refresh_token and your client_id to get a new one. A refresh token lasts 30 days, and each refresh returns a new refresh token, so store it.
A call with a token that is no longer valid answers 401 with the code UNAUTHORIZED. Refresh the token, and if that fails, ask the person to connect again.