{"openapi":"3.1.0","info":{"title":"Lyfta API","version":"1.0.0","summary":"Personal workout API and agent OAuth for Lyfta","description":"Self-serve personal API keys and OAuth for read-only training data. Start with the sandbox; generate a key at /community/api; for ChatGPT, Claude, or Cursor paste https://api.lyftadev.com/v2/mcp (see /community/mcp). Request training:read only.","contact":{"name":"Lyfta Support","email":"support@lyfta.app","url":"https://my.lyfta.app/contact"}},"servers":[{"url":"https://my.lyfta.app","description":"Lyfta web companion"}],"tags":[{"name":"Sandbox","description":"No-auth sample data for agents and integrators"},{"name":"Workouts","description":"Personal workout history"},{"name":"Exercises","description":"Performed exercises and catalog search"},{"name":"Programs","description":"Collections and workout templates"},{"name":"Coaching","description":"Coach client list (beta)"},{"name":"Account","description":"Profile and feed for the authenticated user"}],"paths":{"/api/sandbox/v1/workouts":{"get":{"tags":["Sandbox"],"operationId":"getSandboxWorkouts","summary":"Sample workouts without authentication","description":"Returns a static workout list in the same shape as GET /api/v1/workouts. Use this to validate parsers before a user connects a real account.","responses":{"200":{"description":"Sample workout page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkoutList"}}}}}}},"/api/v1/workouts":{"get":{"tags":["Workouts"],"operationId":"listWorkouts","summary":"List the signed-in user's workouts","description":"Returns detailed workouts (exercises, sets, reps, weights). Optional from/to filter UTC calendar days on timeline_time. Omit both for the previous unfiltered behavior. limit=1 returns the latest completed workout.","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"from","in":"query","description":"Inclusive start date (YYYY-MM-DD). Filters on indexed timeline_time using UTC calendar days. Existing callers that omit from/to are unchanged.","schema":{"type":"string","format":"date","example":"2026-09-01"}},{"name":"to","in":"query","description":"Inclusive end date (YYYY-MM-DD). Filters on indexed timeline_time using UTC calendar days. Must be on or after from when both are set.","schema":{"type":"string","format":"date","example":"2026-09-08"}},{"name":"client_id","in":"query","description":"Coach only. Return workouts for this client instead of the authenticated user. Prefer the public client_id from GET /api/v1/clients (lyfta.coach.public_id). Numeric IDs still work. The key owner must be the accepted coach. Works together with from, to, limit, and page.","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated workouts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkoutList"}}}},"400":{"description":"Invalid from/to date, or from is after to"},"401":{"description":"Missing or invalid credentials"},"429":{"description":"Rate limit exceeded"}}}},"/api/v1/workouts/summary":{"get":{"tags":["Workouts"],"operationId":"listWorkoutSummaries","summary":"List workout summaries","description":"Returns workout headers only (no exercises or sets). Soft-deleted rows are omitted and results are ordered by id descending. current_page is the resolved page number.","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":20}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"client_id","in":"query","description":"Coach only. Public client_id from GET /api/v1/clients (lyfta.coach.public_id). Numeric IDs still work.","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated workout summaries"},"401":{"description":"Missing or invalid credentials"},"429":{"description":"Rate limit exceeded"}}}},"/api/v1/exercises":{"get":{"tags":["Exercises"],"operationId":"listPerformedExercises","summary":"List performed exercises","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Performed exercises"}}}},"/api/v1/exercises/library":{"get":{"tags":["Exercises"],"operationId":"searchExerciseLibrary","summary":"Search the Lyfta exercise catalog","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Catalog search results"}}}},"/api/v1/exercises/progress":{"get":{"tags":["Exercises"],"operationId":"getExerciseProgress","summary":"Retrieve exercise progress","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Exercise progress"}}}},"/api/v1/collections":{"get":{"tags":["Programs"],"operationId":"listCollections","summary":"List saved collections","description":"Returns saved programs/collections. List items include id, title, image, workout_ids, and workout_count. Optional client_id for coaches.","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"client_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated collections"}}},"post":{"tags":["Programs"],"operationId":"createCollection","summary":"Create a program collection","security":[{"apiKey":[]}],"responses":{"200":{"description":"Collection created"}}}},"/api/v1/collections/{id}":{"get":{"tags":["Programs"],"operationId":"getCollection","summary":"Get a collection","description":"view=summary returns workout cards. view=full includes complete template JSON.","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"view","in":"query","schema":{"type":"string","enum":["summary","full"],"default":"summary"}},{"name":"client_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Collection detail"}}}},"/api/v1/templates":{"get":{"tags":["Programs"],"operationId":"listTemplates","summary":"List saved templates","description":"Returns template cards (title, picture, exercise_count, collection). Optional client_id for coaches.","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"client_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated templates"}}},"post":{"tags":["Programs"],"operationId":"createTemplate","summary":"Create a workout template","security":[{"apiKey":[]}],"responses":{"200":{"description":"Template created"}}}},"/api/v1/templates/{id}":{"get":{"tags":["Programs"],"operationId":"getTemplate","summary":"Get a template","description":"Full saved workout, including exercises and sets.","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"client_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Template detail"}}}},"/api/v1/schedule":{"get":{"tags":["Schedule"],"operationId":"listSchedule","summary":"List upcoming scheduled workouts","description":"Combines calendar workouts and followed-plan workouts. from defaults to today, to defaults to +90 days, incomplete only. include_completed=true includes completed items. Optional client_id for coaches. Completed history is GET /api/v1/workouts.","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"parameters":[{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"include_completed","in":"query","schema":{"type":"boolean","default":false}},{"name":"client_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Scheduled workouts"}}}},"/api/v1/me":{"get":{"tags":["Account"],"operationId":"getPublicUser","summary":"Stable user id","description":"Returns the API key owner or the user who consented to a partner OAuth token.","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"responses":{"200":{"description":"User id"},"401":{"description":"Missing or invalid credentials"}}}},"/api/v1/profile":{"get":{"tags":["Account"],"operationId":"getPublicProfile","summary":"Full profile for the authenticated user","description":"Same fields as the app full profile: name, photo, bio, and follower, following, workout, and program counts. client_id is coach-only and is ignored for a partner OAuth token.","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"parameters":[{"name":"client_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Profile"},"401":{"description":"Missing or invalid credentials"}}}},"/api/v1/feed":{"get":{"tags":["Account"],"operationId":"listOwnFeed","summary":"Feed items authored by the user","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"client_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Own feed"},"401":{"description":"Missing or invalid credentials"}}}},"/api/v1/feed/home":{"get":{"tags":["Account"],"operationId":"listHomeFeed","summary":"Home feed for the user","description":"The user's posts plus posts from people they follow.","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"client_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Home feed"},"401":{"description":"Missing or invalid credentials"}}}},"/api/v1/clients":{"get":{"tags":["Coaching"],"operationId":"listCoachClients","summary":"List coach clients (beta)","description":"Returns the API key owner's coaching clients. client_id is lyfta.coach.public_id (not the numeric user id) and can be passed to GET /api/v1/workouts. status \"1\" is accepted, \"0\" is pending. Soft-deleted relationships are omitted. Same rate limits as other public routes: 60/min and 5,000/day.","security":[{"apiKey":[]}],"responses":{"200":{"description":"Client list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoachClientList"}}}},"401":{"description":"Missing or invalid credentials"},"429":{"description":"Rate limit exceeded"}}}}},"components":{"securitySchemes":{"oauth2":{"type":"oauth2","description":"Authorization-code + PKCE for agents such as ChatGPT and Claude. Request the least privilege needed. training:read is the only agent scope currently granted.","flows":{"authorizationCode":{"authorizationUrl":"https://my.lyfta.app/oauth/authorize","tokenUrl":"https://my.lyfta.app/oauth/token","scopes":{"training:read":"Read workouts, personal records, and the signed-in user's training schedule. Cannot create, change, or delete data."}}}},"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Self-serve personal API key generated at /community/api after sign-in. Send as Authorization: Bearer <key>."}},"schemas":{"CoachClientList":{"type":"object","properties":{"status":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/CoachClient"}}}},"CoachClient":{"type":"object","properties":{"username":{"type":"string"},"photo":{"type":"string"},"first":{"type":"string"},"last":{"type":"string"},"status":{"type":"string","description":"\"1\" accepted, \"0\" pending"},"client_id":{"type":"string","description":"lyfta.coach.public_id. Pass this to GET /api/v1/workouts?client_id=..."}}},"WorkoutList":{"type":"object","properties":{"status":{"type":"boolean"},"count":{"type":"integer"},"total_records":{"type":"integer"},"total_pages":{"type":"integer"},"current_page":{"type":"integer"},"limit":{"type":"integer"},"sandbox":{"type":"boolean"},"workouts":{"type":"array","items":{"$ref":"#/components/schemas/Workout"}}}},"Workout":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"body_weight":{"type":"number"},"workout_perform_date":{"type":"string"},"total_volume":{"type":"number"},"totalLiftedWeight":{"type":"number"},"user":{"type":"object","properties":{"username":{"type":"string"}}},"exercises":{"type":"array","items":{"$ref":"#/components/schemas/WorkoutExercise"}}}},"WorkoutExercise":{"type":"object","properties":{"exercise_id":{"type":"integer"},"excercise_name":{"type":"string","description":"Exercise name. The double-c spelling is the live API field name and must be used as-is."},"exercise_type":{"type":"string"},"sets":{"type":"array","items":{"$ref":"#/components/schemas/WorkoutSet"}}}},"WorkoutSet":{"type":"object","properties":{"id":{"type":"string"},"weight":{"type":"string"},"reps":{"type":"string"},"set_type_id":{"type":"string"},"is_completed":{"type":"boolean"}}}}}}