Spaces:
Running on T4
Running on T4
File size: 1,913 Bytes
2756f0f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # JSON examples from the frontend spec (camelCase there; our API uses snake_case for the same fields)
A1 register request/response:
{ "email": "ahmed@example.com", "password": "correct-horse-9", "role": "player" }
201 { "user": { "id", "email", "role": "player", "focus": "both",
"profile": { "name": "", "age": null, "heightCm": null, "weightKg": null, "bats": "R", "throws": "R", "level": "High school" },
"unit": "imperial", "plan": "free", "privateVideos": true, "teamCode": null, "createdAt" },
"tokens": { "accessToken", "refreshToken", "expiresIn": 3600 } }
Error: { "error": { "code": "EMAIL_TAKEN", "message": "An account with this email already exists." } }
B1 GET /me:
{ "user": {...same as A1 user...},
"team": { "code": "KDA-4821", "name": "Karachi Diamond Academy", "coachId", "coachName": "Imran Baig", "coaching": "both", "createdAt" },
"entitlement": { "plan": "free", "weeklyLimit": 3, "usedThisWeek": 1, "left": 2, "windowDays": 7 } }
B2 PATCH /me request (all optional):
{ "role": "coach", "focus": "h", "unit": "metric", "privateVideos": false,
"profile": { "name": "Ahmed Rehman", "age": 15, "heightCm": 168, "weightKg": 60, "bats": "R", "throws": "R", "level": "High school" } }
D2 POST /sessions request:
{ "uploadId": "u9...", "thumbUploadId": "u10...", "mode": "h", "isSelf": true, "athlete": null, "durationSec": 3.87, "fps": 30,
"marks": { "contactFrame": 84, "contactOffset": -2, "contactSource": "detected", "strideStartFrame": 58, "strideEndFrame": 79,
"pitcherDir": { "from": [0.56, 0.86], "to": [0.90, 0.64] } },
"clientCreatedAt": "2026-10-22T10:12:03Z" }
F1 roster item:
{ "id", "name": "Ahmed Rehman", "email", "focus": "h", "level": "High school", "joinedAt", "pendingCount": 1,
"last": { "h": { "sessionId", "score": 71, "delta": 3, "createdAt", "topFix": "Pelvis load" }, "p": null },
"recent": { "h": [71, 68, 69] } }
|