{
  "openapi": "3.0.3",
  "info": {
    "title": "Plan My Workout",
    "version": "1.1.0",
    "description": "Simple weekly workout plans (including running plans from walk-run to 5K and 10K) and plain how-to guides for exercises. Plans use established splits (full body for 2 to 3 days, upper and lower for 4, push, pull and legs for 5 to 6), with sets, reps, rest, a warm-up and a cool-down for strength, muscle building, general fitness, conditioning or mobility, at home or in the gym. Every answer has a ready-to-read `say` line and a `note`: general fitness information, not medical advice. Read only, no account, nothing stored. Exercise pictures and details from wger.de, the free open exercise database. Kit links are Amazon affiliate links.",
    "contact": {
      "email": "hello@askmizan.com"
    }
  },
  "servers": [
    {
      "url": "https://planmyworkout.pages.dev"
    }
  ],
  "paths": {
    "/v1/plan": {
      "get": {
        "operationId": "getWorkoutPlan",
        "summary": "A weekly workout plan with sets, reps and rest",
        "description": "Use for \"make me a 3 day beginner gym plan\", \"home workout with just dumbbells, 30 minutes\", \"a 5 day muscle building split\", \"I have a pull-up bar and dumbbells\", \"a 20 minute workout\" (days=1 gives a single session), \"a workout plan to lose weight\", \"couch to 5K\" or \"a 10K running plan\", or \"give me another one\" (send the same inputs with seed plus one). Either pass the fields, or pass the user's words in q and the service reads days, minutes, level, goal and equipment from them. Fields win over q. Running plans also return weeks: every week's sessions (a 9-week walk-run build to 30 minutes of running for beginners; easy, interval, tempo and long runs for intermediates), with week 1 laid out in days. Read out `say`, and always include the `note`. Kit links are suggestions to offer after the plan.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "The user's request in their own words, for example \"3 day beginner gym plan, 45 minutes\".",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "goal",
            "in": "query",
            "required": false,
            "description": "strength, muscle, general (default), conditioning (use this for fat loss or weight loss requests), running or mobility.",
            "schema": {
              "type": "string",
              "example": "muscle"
            }
          },
          {
            "name": "level",
            "in": "query",
            "required": false,
            "description": "beginner (default) or intermediate. Advanced is treated as intermediate.",
            "schema": {
              "type": "string",
              "enum": [
                "beginner",
                "intermediate"
              ]
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Days per week, 1 to 6 (1 gives a single session; more than 6 is planned as 6 with a rest day). Default 3.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 7
            }
          },
          {
            "name": "minutes",
            "in": "query",
            "required": false,
            "description": "Minutes per session including warm-up, 15 to 120. Default 45.",
            "schema": {
              "type": "integer",
              "minimum": 15,
              "maximum": 120
            }
          },
          {
            "name": "equipment",
            "in": "query",
            "required": false,
            "description": "Comma separated: none (default), dumbbells, barbell, gym, bands, kettlebell, pullupbar (a pull-up bar), jumprope.",
            "schema": {
              "type": "string",
              "example": "dumbbells,bands"
            }
          },
          {
            "name": "seed",
            "in": "query",
            "required": false,
            "description": "0 to 9999. Change it for a different mix of exercises with the same setup. Default 0.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "Two-letter country code for kit links (US, GB, IE, CA, AU). Defaults to the visitor's country.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plan with warm-up, days, exercises, progression, say, note and kit links"
          },
          "400": {
            "description": "Input out of range"
          },
          "503": {
            "description": "Upstream unavailable"
          }
        }
      }
    },
    "/v1/exercise": {
      "get": {
        "operationId": "getExercise",
        "summary": "How to do one exercise, the muscles it works and a picture",
        "description": "Use for \"how do I do a Romanian deadlift?\", \"what is a goblet squat?\", \"what muscles do face pulls work?\". Understands everyday names like RDL, press-up and lat pulldown.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 60,
              "example": "Romanian deadlift"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exercise guide"
          },
          "400": {
            "description": "Missing name"
          },
          "404": {
            "description": "Exercise not found"
          },
          "503": {
            "description": "Upstream unavailable"
          }
        }
      }
    },
    "/v1/exercises": {
      "get": {
        "operationId": "listExercises",
        "summary": "Exercises for a muscle and the equipment the user has",
        "description": "Use for \"what can I do for chest with no equipment?\", \"glute exercises with bands\", \"back exercises with dumbbells\", \"some mobility moves\". Give a muscle, equipment or both.",
        "parameters": [
          {
            "name": "muscle",
            "in": "query",
            "required": false,
            "description": "chest, back, shoulders, arms, biceps, triceps, legs, quads, hamstrings, glutes, calves, core (or abs), cardio or mobility. Also forearms (grip) and traps.",
            "schema": {
              "type": "string",
              "example": "chest"
            }
          },
          {
            "name": "equipment",
            "in": "query",
            "required": false,
            "description": "none, dumbbells, barbell, gym, bands, kettlebell, pullupbar or jumprope.",
            "schema": {
              "type": "string",
              "example": "none"
            }
          },
          {
            "name": "level",
            "in": "query",
            "required": false,
            "description": "beginner leaves out harder moves.",
            "schema": {
              "type": "string",
              "enum": [
                "beginner",
                "intermediate"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 10. Default 8.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exercise list"
          },
          "400": {
            "description": "Missing or unknown muscle or equipment"
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "operationId": "health",
        "summary": "Service status",
        "description": "For monitoring only.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}