{"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; request training:read for ChatGPT or Claude.","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)"}],"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","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}}],"responses":{"200":{"description":"Paginated workouts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkoutList"}}}},"401":{"description":"Missing or invalid credentials"},"429":{"description":"Rate limit exceeded"}}}},"/api/v1/workouts/summary":{"get":{"tags":["Workouts"],"operationId":"listWorkoutSummaries","summary":"List workout summaries","security":[{"oauth2":["training:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Paginated workout summaries"}}}},"/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":{"post":{"tags":["Programs"],"operationId":"createCollection","summary":"Create a program collection","security":[{"apiKey":[]}],"responses":{"200":{"description":"Collection created"}}}},"/api/v1/templates":{"post":{"tags":["Programs"],"operationId":"createTemplate","summary":"Create a workout template","security":[{"apiKey":[]}],"responses":{"200":{"description":"Template created"}}}},"/api/v1/clients":{"get":{"tags":["Coaching"],"operationId":"listCoachClients","summary":"List coach clients (beta)","security":[{"apiKey":[]}],"responses":{"200":{"description":"Client list"}}}}},"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":{"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"}}}}}}