client_id and client_secret scoped to one practice. Elation delivers them to you in a server-to-server call that you authenticate.
1. How the connection works
There are three parties: the practice admin’s browser, Elation, and you. Steps 2 to 9 are a standard OAuth 2.0 authorization code grant (RFC 6749 §4.1), with Elation as the client and you as the authorization server. The access token you issue has exactly one job: it proves to your credential callback that the delivery belongs to the account that consented. Elation does not call any other API of yours with it. Steps 10 to 12 are specific to Elation. Everything from step 8 onwards happens inside the single browser request in step 7, so the admin is waiting on your token and callback endpoints.2. Onboarding: what you exchange with Elation
All three of your URLs must be absolute
https URLs on a hostname (no IP literals, no localhost), served with a certificate from a publicly trusted CA. Register the final URL: Elation does not follow redirects on server-to-server calls, so a 301 that adds a trailing slash fails the connection.
3. Endpoint 1: Authorization (browser)
GET {authorize_url}
Request
Elation sends the admin’s browser here with these query parameters, all percent-encoded:practice_id and practice_name let your consent page show which Elation practice is being connected, and let you turn away a connection you will not accept (for example, a practice already linked to a different account) with error=access_denied before any credential exists. They are informational: they are not signed, so do not use them to decide which of your accounts receives the credential. The access token does that (Endpoint 3).
Elation does not send scope, code_challenge (PKCE), nonce, or prompt. Do not require them. The access being granted is fixed at onboarding.
What you must do
- Reject an unknown
client_idand anyredirect_urithat is not an exact match for the one registered to that client. Show an error page; do not redirect to an unregistered URI. - Reject a
response_typeother thancode(redirect witherror=unsupported_response_typeonce the redirect URI is validated). - Sign the user in if needed. Preserve every original query parameter across your login flow, including
statebyte-for-byte. - Show a consent page naming Elation and the practice-data access.
- On approval, issue an authorization code and redirect the browser.
Response: approved
- Put
codeandstatein the query string. Not the fragment, and notresponse_mode=form_post. - Return
stateexactly as received. Elation verifies its signature; one changed character fails the connection. - If your consent page submits a
POSTform, redirect with302or303. A307or308makes the browser re-POSTto Elation’s callback, which only acceptsGET. - Percent-encode both values.
Response: denied or failed
state so Elation can attribute the outcome to the right attempt. Elation records only these error values verbatim and maps anything else to unknown_error: invalid_request, unauthorized_client, access_denied, unsupported_response_type, invalid_scope, server_error, temporarily_unavailable. error_description is ignored.
Timing
Thestate value expires 10 minutes after the admin clicks Connect. If they take longer at your consent page, Elation rejects the redirect and they start over from Elation.
4. Endpoint 2: Token
POST {token_url}
Request
client_secret_basic). The client id and secret are never in the body.
4.1 What you must validate
- The Basic credentials match the client. Otherwise
401with{"error": "invalid_client"}. grant_typeisauthorization_code. Otherwise400with{"error": "unsupported_grant_type"}.codeexists, was issued to this client, has not expired, and has not been used. Otherwise400with{"error": "invalid_grant"}.redirect_uriequals the one the code was issued for. Otherwise400with{"error": "invalid_grant"}.- Mark the code used atomically before responding.
4.2 Client secret encoding
As RFC 6749 §2.3.1 requires, Elation form-urlencodes the client id and secret before base64-encodingclient_id:client_secret. URL-decode each half after splitting on the first :. If your server compares the raw decoded values, a secret containing +, %, / or other reserved characters will not match. Issue a secret made only of unreserved characters (A-Z a-z 0-9 - . _ ~) and the two encodings are identical, so either server behavior works.
Response
- The status must be exactly
200. A201fails the connection. access_tokenmust be a non-empty string. Every other field is ignored, includingrefresh_token.- The token must remain valid for at least 5 minutes. Between issuing it and presenting it at your callback, Elation mints the credential, which can take over a minute in the worst case.
- Bind the token to the partner-side account that consented. Your credential callback uses it to decide where the credential belongs.
- Respond within 10 seconds, including connection setup.
5. Endpoint 3: Credential callback
POST {credential_callback_url}
Request
A
practice_id is only meaningful within its environment. If you integrate with more than one Elation environment, key stored credentials by (environment, practice_id).
Elation may add fields. Ignore ones you do not recognize.
What you must do
- Authenticate the bearer token: it must be one you issued from the token endpoint and unexpired. Otherwise
401. Elation may present the same token more than once for the samerequest_id(see Retries), so do not consume it on a failed delivery, and answer2xxto a repeat of a delivery you already stored. - Attach the credential to the account the token belongs to. Do not use
practice_idto find the account: it is informational, and the token is what proves the delivery is for that user. - Store
client_secretencrypted. Never log it, and never echo it in a response body. - If the account already holds a credential for the same
environmentandpractice_id, replace it. A practice that disconnects and reconnects gets a new credential; the old one has been revoked. - Respond
2xxwithin 10 seconds. The body is ignored. Do any slow follow-up work (first sync, emails) after responding.
Retries
Elation makes up to three delivery attempts, a second or two apart, while the practice admin waits on the redirect. It retries only when your endpoint is unreachable, takes longer than 10 seconds, or answers408, 425, 429, 500, 502, 503 or 504. Elation sets the retry timing and ignores Retry-After. Every attempt carries the same request_id, credential and bearer token. Treat request_id as an idempotency key: if you already stored that delivery, answer 2xx again.
Any other status, a redirect, or a third failure is final. Elation records the connection as failed, and Elation Support has to clean up the credential before the practice can try again. Your callback is the reliability-critical endpoint in this integration.
If your handler stores the credential after Elation has stopped waiting on the last attempt, you hold a credential that Elation has already recorded as failed. Elation Support revokes it during cleanup, and the practice sees the connection as failed. Store the credential and respond first; do everything else afterwards.
6. After connection
- Using the credential. The
client_idandclient_secretare Elation API client credentials for the API atapi_base_url. Exchange them for an access token with the client credentials grant; no username or password is needed. See Authentication and Get Token. - Disconnects. A practice admin or Elation Support can disconnect at any time. Elation revokes the credential. You are not notified. Treat an authentication failure from the Elation API as a disconnect and stop syncing for that practice.
- Reconnects. After a disconnect or a declined attempt, the admin can connect again. You receive a new delivery with a new
request_idand a new credential. - One connection per practice. Elation allows a single active connection between a practice and your product. While a connection is active, or a failed delivery is waiting on Elation Support, Elation refuses a new Connect and the existing credential is untouched.
7. What Elation records for each outcome
Practice admins see these on Elation’s status page. Use the table to reason about what your endpoints’ behavior does to the practice.DECLINED means no credential was created. DELIVERY_FAILED means a credential may exist that nobody holds, which is why it needs a person to resolve it.
Testing your integration
While you build against a sandbox practice, ask Elation to turn on debug mode for it. With debug mode on, the practice admin:- Can Disconnect from
DELIVERY_FAILED, and from an attempt stuck connecting, not only fromACTIVE, once Elation has recorded the attempt’s credential. Elation revokes that credential, so you can reconnect without waiting for Elation Support. An attempt that failed before a credential was recorded still needs Elation Support. - Sees the recorded failure reason on the integration card: a short description and a status code, never your response body.
Only disconnect a stuck attempt after its callback has finished or timed out. If your callback is still running, it can still mark the connection
ACTIVE, leaving you holding a credential that has already been revoked.8. Checklist
- Exact-match
client_idandredirect_urion the authorize request. - Do not require
scopeor PKCE. - Preserve
statebyte-for-byte through login and consent. - Redirect with
302or303, withcodeandstatein the query string. - Include
stateon error redirects, and use standarderrorcodes. - Token endpoint: Basic auth, single-use codes,
redirect_urimatch,200JSON withaccess_token. - The client secret uses only unreserved characters.
- The access token is valid for at least 5 minutes and bound to the consenting account.
- Callback: authenticate the bearer token, bind by token not
practice_id, store the secret encrypted, never log or echo it. - Callback replaces an existing credential for the same
environmentand practice. - Callback treats a repeated
request_idas already stored and answers2xx; a failed delivery does not consume the bearer token. - Every endpoint answers within 10 seconds, with no redirects on server-to-server URLs.
- Treat Elation API authentication failures as a disconnect.
Appendix A: Linking a practice to your card
To send a practice admin straight to your integration, for example from your own onboarding flow or an email, link to Elation’s partner integrations settings page with yourpartner_id as vendor_id:
partner_id is the identifier Elation assigns at onboarding; ask Elation if you do not have it. It is case-sensitive.
- The link only scrolls. It does not start a connection: the admin still clicks Connect and confirms the access shown in the Connect dialog.
- If the practice cannot see your card, for example because your integration is not yet available to it, the page opens at the top with no error.