Skip to content

Per-metric trend for a client by public share token

GET
/api/clients/shared/{token}/trend/
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.

  • None
token
required
string
activity
required
string

Activity key (e.g. running). Required.

metric
string

Metric key; defaults to the activity’s first headline metric when omitted.

range
string

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).

Media typeapplication/json

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
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
range_days
required
integer
range_start
required
string format: date
range_end
required
string format: date
metric
required
string
available_metrics
required
Array<object>
object
key
required
string
label
required
string
unit
required

One of the canonical Unit literal strings (see domain/metrics/base.py).

string
higher_is_better
required
boolean
nullable
min_good
required
number format: double
nullable
max_good
required
number format: double
nullable
beta
required

Metric has not cleared clinical / force-plate validation; the UI shows a ‘beta’ precision caveat.

boolean
headline_metrics
required
Array<string>
activity_breakdown
required
Array<object>
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
count
required
integer
last_session_at
required
string format: date-time
nullable
series
required
Array<object>

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
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
baseline
required
number format: double
nullable
personal_best
required
number format: double
nullable
generated_at
required
string format: date-time
Example
{
"activity": "running",
"activity_breakdown": [
{
"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
Examplegenerated
{
"detail": "example"
}
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—UnknownOrRevokedToken

Absent, never existed, or the coach revoked the link

{
"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—LinkExpired

The share carried an `expires_at` now in the past

{
"detail": "share_expired"
}