Per-metric trend for a client by public share token
const url = 'http://localhost:8000/api/clients/shared/example/trend/?activity=example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:8000/api/clients/shared/example/trend/?activity=example'Public, token-gated read of one metric’s per-session trend for a shared client profile — the public twin of the authenticated dashboard client-trend, so the /c/:token page draws the same per-session line + target band + baseline + personal-best the coach sees inside the profile. Redacted: no client_id, no coach recommendations, and every point omits its raw session_id (structural — the response schema has no field for it). Does NOT bump the view counter (it’s a sub-fetch of the page, driven by the metric picker). 400 for a missing activity or an unknown metric, 404 for an unknown / revoked token (or hard-deleted client / unknown activity), 410 if the share’s expires_at is in the past.
Auth: none — the token in the path is the credential.
Authorizations
Section titled “Authorizations”- None
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Activity key (e.g. running). Required.
Metric key; defaults to the activity’s first headline metric when omitted.
Range preset (e.g. 90d) or a custom from/to pair; defaults to a 14-day window (the public page sends an all-time window to match the internal profile).
Responses
Section titled “Responses”Redacted per-metric trend for the /c/:token page — the public
twin of the authenticated dashboard client-trend, so the shared page
can draw the same per-session line + target band + baseline +
personal-best the coach sees inside the profile.
Structurally redacted: the internal client_id and the coach-facing
recommendations are simply not declared (so they never serialize),
and every series point omits session_id. Everything kept is a
body-movement aggregate carrying no PII.
object
running- Runningwalking- Walkingjump- Vertical Jumpweightlifting- Weightliftingmobility- Mobility Assessmentworkspace_wellness- Workspace Wellnessagility- Agilityfencing- Fencingcycling- Cyclingtennis- Tennispadel- Padel Tennisbowling- Bowlingbaseball- Baseballfootball- Footballbadminton- Badmintoncricket- Cricketbasketball- Basketballscuba_diving- Scuba Divingice_hockey- Ice Hockeyamerican_football- American Footballfri- Falls Risk Indicator
object
One of the canonical Unit literal strings (see domain/metrics/base.py).
Metric has not cleared clinical / force-plate validation; the UI shows a ‘beta’ precision caveat.
object
running- Runningwalking- Walkingjump- Vertical Jumpweightlifting- Weightliftingmobility- Mobility Assessmentworkspace_wellness- Workspace Wellnessagility- Agilityfencing- Fencingcycling- Cyclingtennis- Tennispadel- Padel Tennisbowling- Bowlingbaseball- Baseballfootball- Footballbadminton- Badmintoncricket- Cricketbasketball- Basketballscuba_diving- Scuba Divingice_hockey- Ice Hockeyamerican_football- American Footballfri- Falls Risk Indicator
One per-session point on the public per-metric trend chart —
mirrors the dashboard TrendPointSerializer MINUS session_id. The
redaction is structural: no field here carries a raw session id, so
the public trend endpoint can’t leak one even if upstream regressed
(same contract as the snapshot).
object
Example
{ "activity": "running", "activity_breakdown": [ { "activity": "running" } ]}object
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).
Examplegenerated
{ "detail": "example"}object
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).
Examples
Absent, never existed, or the coach revoked the link
{ "detail": "share_not_found"}object
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).
Examples
The share carried an `expires_at` now in the past
{ "detail": "share_expired"}