Skip to content

Across-session trends for a public share token (redacted)

GET
/api/shared/{token}/trends/
curl --request GET \
--url http://localhost:8000/api/shared/example/trends/

Public, token-gated across-session trends for the shared session (#424) — the same per-metric trajectories the coach sees, but redacted: every session_id is dropped (a one-session share link can’t be used to enumerate or open the client’s OTHER sessions) and the internal client_id is omitted. No curation is applied — the public share renders the full metric set, so its trends cover the same set. Window defaults to a year; narrow with ?range=30d or ?from=&to=. 404 unknown token, 410 expired share.

Auth: none — the token in the path is the credential.

  • None
token
required
string
from
string format: date

Custom window start.

range
string

7d/14d/30d/90d/365d (default 365d).

to
string format: date

Custom window end.

Media typeapplication/json

Shape of GET /api/shared/{token}/trends/ — redacted across-session trends for a public one-session share. No session_id / client_id.

object
activity
required
  • running - Running
  • walking - Walking
  • jump - Vertical Jump
  • weightlifting - Weightlifting
  • mobility - Mobility Assessment
  • workspace_wellness - Workspace Wellness
  • agility - Agility
  • fencing - Fencing
  • cycling - Cycling
  • tennis - Tennis
  • padel - Padel Tennis
  • bowling - Bowling
  • baseball - Baseball
  • football - Football
  • badminton - Badminton
  • cricket - Cricket
  • basketball - Basketball
  • scuba_diving - Scuba Diving
  • ice_hockey - Ice Hockey
  • american_football - American Football
  • fri - Falls Risk Indicator
string
Allowed values: running walking jump weightlifting mobility workspace_wellness agility fencing cycling tennis padel bowling baseball football badminton cricket basketball scuba_diving ice_hockey american_football fri
exercise
required
string
range_days
required
integer
range_start
required
string format: date
range_end
required
string format: date
generated_at
required
string format: date-time
metrics
required
Array<object>
object
key
required
string
label
required
string
unit
required
string
higher_is_better
required
boolean
nullable
target_min
required
number format: double
nullable
target_max
required
number format: double
nullable
baseline
required
number format: double
nullable
personal_best
required
number format: double
nullable
series
required
Array<object>

One across-session point on a public share — drill-in identifiers (session_id) intentionally dropped.

object
created_at
required
string format: date-time
value
required
number format: double
nullable
score
required
number format: double
nullable
target_min
required
number format: double
nullable
target_max
required
number format: double
nullable
in_zone
required
boolean
nullable
delta_vs_prev
required
number format: double
nullable
is_personal_best
required
boolean
Example
{
"activity": "running"
}
Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string
Examples
Example404—UnknownShareToken

404 — Unknown share token

{
"detail": "share_not_found"
}
Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string
Examples
Example410—ShareLinkExpired

410 — Share link expired

{
"detail": "share_expired"
}