Workout Sessions API
Every completed workout session is stored server-side, tied to the userId the SDK was initialized with (sessions are persisted when the workout is launched with shouldSendStats: true). Fetch the history to build progress screens, completed-workout lists, or analytics.
1GET https://data.kinestex.com/api/workout-sessionsHeaders:
| Header | Description |
x-api-key | Your company API key (server-side only) |
x-user-id | The user's id — always send it; it must match the SDK's userId |
Query params (all optional): page (default 1), limit (default 20, max 50), sort (default started_at_desc).
Response (trimmed to the most useful fields):
1{
2 "sessions": [
3 {
4 "id": 4978,
5 "content_title": "Fitness Lite",
6 "content_image_url": "https://cdn.kinestex.com/uploads%2F...webp",
7 "content_difficulty": "Medium",
8 "calories_burned": 1.03,
9 "actual_duration_seconds": 12,
10 "completion_percentage": 0.67,
11 "total_exercises": 10
12 }
13 ],
14 "pagination": { "page": 1, "limit": 20, "total": 1, "total_pages": 1, "has_more": false }
15}Each session also carries planned_exercises[] (with per-exercise thumbnails and rep/time targets), accuracy_score, efficiency_score, total_mistakes, and timestamps.
Key rules:
- The values are actuals:
calories_burnedis what the user really burned andactual_duration_secondsis real time spent (in seconds — format it; don't show "0 min" for short sessions). completion_percentage(0–100, can be fractional like0.67) is authoritative — never derive completion from exercise counts, sincetotal_exercisesincludes untouched exercises.- Errors:
401invalidx-api-key·404x-user-idnot found for your company ·400bad query param.
To open a full session summary in your app, pass the session id to the SDK's custom component view with route session/{id}. The complete card-building walkthrough (Swift + Kotlin) is in Displaying completed workouts.