Skip to main content

[Early Access] Wearable OAuth callback

GET /v1/wearables/{provider}/callback
devhttps://api.sandbox.ovok.com

Early Access — interfaces may change without notice.

Endpoint the provider redirects the user to after they authorize. The dashboard does not call this directly — the user's browser does, via a 302 from the provider.

We exchange the code query parameter for an access + refresh token pair, persist them as a FHIR Endpoint resource (encrypted, keyed on the project), then either redirect the browser to the redirectUri the dashboard supplied at connect time, or return a 200 { ok: true, provider, patientId } JSON payload.

Query parameters

NameNotes
codeAuthorization code returned by the provider. Required on success.
stateOpaque CSRF token we minted at connect time. Required on success.
errorSet when the user denied or the provider failed. We forward 400.
error_descriptionHuman-readable error context (optional).

Notes

The state token is single-use (Redis GETDEL) — replays return 401. State expires after 600 seconds; if the user takes longer to authorize, the flow must be restarted.

Parameters

NameInTypeRequiredDescription
providerpathstringyesWearable provider slug. Must match the one passed to /connect — mismatch is rejected.
error_descriptionquerynoOptional human-readable error context from the provider.
errorquerynoSet by the provider when the user denied or the upstream OAuth failed. Forwarded as a 400.
statequerynoOpaque CSRF token we minted at /connect. Single-use (Redis GETDEL). Replays return 401.
codequerynoAuthorization code returned by the provider on success. Exchanged server-side for tokens.

Responses

CodeDescription
200Success.
400The request could not be operated by the server.
401The resource owner or authorization server denied the request.
404The requested resource could not be found.
422The request could not be validated by the server.
500The server encountered an unexpected condition. Please try again later.

200OkResponseDto (application/json)

Side-effect-only acknowledgement. Body is the literal { "ok": true }.

  • ok: boolean (required)