Generate Widget Session
Changed onGenerate a Terra widget session for user authentication.
Google Health uses the authenticated athlete's id as its reference and restricts the widget to GOOGLE_HEALTH. If this Firebase session has no athlete yet, the shared provisioner creates one. A supplied reference must belong to that session. Other providers keep the per-session flow below.
Legacy sessions pass a fresh, never-reused reference_id (not the Firebase UID) so Terra never sees the same reference twice across reinstalls — that's what stops the duplicate-account / orphaned-data bleeding (#979, #1094): no ambiguous state, user_reauth never fires. The Firebase UID and the device timezone (from the X-Device-Timezone header, PR #529) are persisted on a TerraSession row keyed by the widget session id Terra returns. The auth webhook reads the row by widget_session_id to recover the identity and rewrite the reference to the imperfect-api user id.
Request
- Base URLhttps://api.imperfect.co (the document declares no server; this is the origin it was published from)
- URLhttps://api.imperfect.co/session
- AuthHTTP bearer
Headers
Request body
Response
Successful Response
Changes
- info
added the new optional request property
- info