S256 challenge method is accepted.
Prerequisites
- Your
client_idandclient_secret, issued by Everbility during onboarding. - Your registered
redirect_uri. Every request must use it exactly as registered — there is no wildcard or path matching. - An HTTPS webhook endpoint if you want launch-session events. Everbility registers this during onboarding.
- A dedicated
webhook_secret, issued separately from your OAuthclient_secret, if webhooks are enabled. - The approving user must be an organisation admin in Everbility. Other users see the consent page but cannot approve.
Redirect URIs are an OAuth security boundary and cannot be changed dynamically. Use a separately registered partner app for each environment so authorization codes, credentials, tokens, and connections remain isolated and auditable.
1
Generate the PKCE pair and state
For every connection attempt, generate a fresh Store
state and a fresh code_verifier (43–128 characters from A–Z a–z 0–9 - . _ ~), then derive the challenge:state and code_verifier server-side against the pending attempt — you need both when the callback arrives.2
Send the admin to the consent page
Redirect the practice admin’s browser to:The admin signs in to Everbility if needed, reviews what your app will be able to do, and approves. Links missing valid PKCE parameters show an error card and cannot be approved.
3
Handle the callback
On approval, the browser is redirected to your If the admin cancels, you receive
redirect_uri:?error=access_denied&state=<your state> instead.Verify that state matches a pending attempt before continuing, then look up its code_verifier. The code is single-use and expires after 5 minutes.4
Exchange the code for tokens
Call the token endpoint from your server. It accepts form-encoded or JSON bodies.Store both tokens securely, keyed by practice. Exchanging a code revokes any tokens previously issued for the same connection.
Response
5
Call the Partner API
Send the access token as a bearer token on every partner endpoint:
Refresh tokens and rotation
Access tokens last 1 hour; refresh tokens last 90 days. Refresh before or after expiry with:- Each refresh token is single use. Always persist the new pair from the response before discarding the old one.
- The previous access token is revoked when you refresh.
- Presenting an already-used refresh token is treated as theft: every token for the connection is revoked, open launch sessions are expired, and the connection status becomes
reauthorization_required. The response is401 Refresh token reuse detected. - After 90 days without a successful refresh, the refresh token expires with
401 Refresh token expired, and the connection likewise requires re-authorization.
Re-authorization
When a connection reachesreauthorization_required (refresh expiry or token reuse), or a practice admin revokes it from Everbility, all API calls return 401. To recover, send a practice admin through the consent flow again — approving reactivates the same connection, and existing client mappings are preserved.
Revoking a connection
Either side can end a connection:- Your platform:
POST /v1/partner/oauth/revokewithclient_id,client_secret, and anytokenfrom the connection (access or refresh). This revokes the entire connection, not just the presented token, and always returns{"revoked": true}. - The practice: an organisation admin disconnects your app from within Everbility.
Errors
Errors use the standard shape: