Skip to content

List preset exercises, recording guides, and metric specs

GET
/api/exercises/
curl --request GET \
--url http://localhost:8000/api/exercises/ \
--header 'Authorization: Bearer <token>'

The catalogue endpoint. Pass ?activity=running (or any supported activity) to receive the curated preset list, the activity-level recording guide (camera placement, framing, lighting), per-exercise overrides where they exist (use guides_by_exercise[exercise] if present, fall back to guide), the list of MetricSpec dicts the analyzers will emit, and the supported camera views per exercise. Use this to drive a dynamic upload UI — exercise picker, recording instructions, view picker (per pair, not per activity), and a preview of which metrics this session will produce. ?lang=en|ru localises the recording guide text.

Omit activity and the response carries by_activity — every activity mapped to its preset list — with presets / metrics / views_by_exercise left empty. That is the shape a picker grouping exercises under activity headings needs, and it costs one request instead of one per activity.

activity
string

Activity to fetch the catalogue for. OMIT it to get the whole catalogue under by_activity instead — one request for a picker that groups exercises by activity (#1354).

lang
string

en (default) or ru — localises the recording guide text.

Media typeapplication/json
object
activity
required
string
presets
required
Array<string>
by_activity
required

Activity → its preset list, the WHOLE catalogue. Populated only when the request omits activity; empty otherwise. Drives the journal’s exercise filter, which groups its options under activity headings and would otherwise need one request per activity to build a single dropdown (#1354).

object
key
additional properties
Array<string>
guide
required

Activity-level default recording guide.

object
key
additional properties
string
guides_by_exercise
required

Per-exercise recording guide. Keyed by exercise name. Falls back to guide when an exercise has no override. Front-ends should prefer this if present.

object
key
additional properties
object
key
additional properties
string
metrics
required

Exercise → list of MetricSpec

object
key
additional properties
Array<object>
object
key
additional properties
views_by_exercise
required

Per-exercise supported camera views — one of side (sagittal, always present), front, back. Front-end uses this to gate the camera-view picker per (activity, exercise) pair: hide when the list has only one entry, show otherwise. Source of truth is aikmodels’ views_for_pair() — adding a frontal/posterior analyzer in aikmodels flows through here without a Django-side edit.

object
key
additional properties
Array<string>
guides_by_exercise_view
required

Per-(exercise, camera_view) recording guide. Nested {exercise: {view: {Camera, Distance, Duration, ...}}}. Front-end shows guides_by_exercise_view[exercise][view] once the user has committed to both — gives a front-camera Bodyweight Squat its own framing recipe instead of the side-view default. Falls back to guides_by_exercise[exercise] (then guide) when a view-specific override doesn’t exist for that pair.

object
key
additional properties
object
key
additional properties
object
key
additional properties
string
Examplegenerated
{
"activity": "example",
"presets": [
"example"
],
"by_activity": {
"additionalProperty": [
"example"
]
},
"guide": {
"additionalProperty": "example"
},
"guides_by_exercise": {
"additionalProperty": {
"additionalProperty": "example"
}
},
"metrics": {
"additionalProperty": [
{
"additionalProperty": "example"
}
]
},
"views_by_exercise": {
"additionalProperty": [
"example"
]
},
"guides_by_exercise_view": {
"additionalProperty": {
"additionalProperty": {
"additionalProperty": "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
Examplegenerated
{
"detail": "example"
}