{
  "openapi": "3.1.0",
  "info": {
    "title": "FitExerciseDB API",
    "version": "1.0.0",
    "summary": "Best-value exercise database REST API: 1,324 exercises, 6 languages, MET-based calorie estimation, curated workouts and multi-week programs.",
    "description": "Paid REST API serving structured exercise metadata for fitness app developers. Bearer-token auth, USD pricing, free tier with 100 req/month and no card. See https://fitexercisedb.com/llms.txt for the LLM-oriented summary and https://fitexercisedb.com/llms-full.txt for the long-form reference.",
    "contact": {
      "name": "FitExerciseDB",
      "url": "https://fitexercisedb.com"
    },
    "license": {
      "name": "Proprietary — see Terms of Service",
      "url": "https://fitexercisedb.com/en/legal/terms"
    }
  },
  "servers": [
    {
      "url": "https://api.fitexercisedb.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Exercises",
      "description": "1,324 exercises with structured metadata"
    },
    {
      "name": "Workouts",
      "description": "16 curated workouts"
    },
    {
      "name": "Programs",
      "description": "6 multi-week training programs"
    },
    {
      "name": "Taxonomies",
      "description": "Body parts, equipment, target muscles"
    },
    {
      "name": "Account",
      "description": "API key info, quota, tier"
    },
    {
      "name": "Health",
      "description": "Liveness probe (no auth)"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Liveness probe",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/exercises": {
      "get": {
        "tags": [
          "Exercises"
        ],
        "summary": "List exercises (paginated, filterable)",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PageSize"
          },
          {
            "name": "bodyPart",
            "in": "query",
            "description": "Filter by body part (e.g. Chest, Back, Waist)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target",
            "in": "query",
            "description": "Filter by target muscle (e.g. Pectorals, Quads)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "equipment",
            "in": "query",
            "description": "Filter by equipment (e.g. Body Weight, Dumbbell)",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of exercises",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExerciseListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/exercises/{id}": {
      "get": {
        "tags": [
          "Exercises"
        ],
        "summary": "Get a single exercise by ID with HATEOAS links",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExerciseId"
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Exercise with _links",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExerciseWithLinks"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/exercises/search": {
      "get": {
        "tags": [
          "Exercises"
        ],
        "summary": "Full-text search across name, target, equipment",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search term",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PageSize"
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked search results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExerciseListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/exercises/{id}/related": {
      "get": {
        "tags": [
          "Exercises"
        ],
        "summary": "5 related exercises (same target, prefer matching equipment)",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExerciseId"
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Related exercises",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Exercise"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/exercises/{id}/calories": {
      "get": {
        "tags": [
          "Exercises"
        ],
        "summary": "Estimate kcal burned (MET × bodyweight × duration)",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExerciseId"
          },
          {
            "name": "bodyweightKg",
            "in": "query",
            "required": true,
            "description": "User bodyweight in kilograms",
            "schema": {
              "type": "number",
              "minimum": 30,
              "maximum": 250
            }
          },
          {
            "name": "minutes",
            "in": "query",
            "required": true,
            "description": "Duration in minutes",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 600
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Calorie estimate",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "exerciseId",
                    "met",
                    "bodyweightKg",
                    "minutes",
                    "kcal"
                  ],
                  "properties": {
                    "exerciseId": {
                      "type": "string",
                      "example": "0001"
                    },
                    "met": {
                      "type": "number",
                      "example": 3.5
                    },
                    "bodyweightKg": {
                      "type": "number",
                      "example": 80
                    },
                    "minutes": {
                      "type": "number",
                      "example": 30
                    },
                    "kcal": {
                      "type": "number",
                      "example": 140
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/random": {
      "get": {
        "tags": [
          "Exercises"
        ],
        "summary": "Return one random exercise",
        "parameters": [
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Random exercise",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Exercise"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/popular": {
      "get": {
        "tags": [
          "Exercises"
        ],
        "summary": "Top 50 exercises by usage volume",
        "parameters": [
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Top 50 exercises",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Exercise"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/workouts": {
      "get": {
        "tags": [
          "Workouts"
        ],
        "summary": "List curated workouts (paginated, filterable)",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "level",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "beginner",
                "intermediate",
                "advanced"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "push",
                "pull",
                "legs",
                "full_body",
                "core",
                "hiit",
                "cardio",
                "recovery"
              ]
            }
          },
          {
            "name": "maxDurationMinutes",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 600
            }
          },
          {
            "name": "equipment",
            "in": "query",
            "description": "Match if any in equipment_needed",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated workouts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkoutListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/workouts/{id}": {
      "get": {
        "tags": [
          "Workouts"
        ],
        "summary": "Workout with embedded exercise list",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Workout detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workout"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/programs": {
      "get": {
        "tags": [
          "Programs"
        ],
        "summary": "List multi-week programs (paginated, filterable)",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "level",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "beginner",
                "intermediate",
                "advanced"
              ]
            }
          },
          {
            "name": "goal",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "strength",
                "hypertrophy",
                "fat_loss",
                "endurance",
                "mobility"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated programs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgramListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/programs/{id}": {
      "get": {
        "tags": [
          "Programs"
        ],
        "summary": "Program with embedded week × day schedule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Program detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Program"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/bodyparts": {
      "get": {
        "tags": [
          "Taxonomies"
        ],
        "summary": "List body parts (10 entries, localized)",
        "parameters": [
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Body parts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/equipment": {
      "get": {
        "tags": [
          "Taxonomies"
        ],
        "summary": "List equipment types (localized)",
        "parameters": [
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Equipment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/targets": {
      "get": {
        "tags": [
          "Taxonomies"
        ],
        "summary": "List target muscles (localized)",
        "parameters": [
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "Target muscles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Current API key info: tier, quota used, quota limit, reset",
        "responses": {
          "200": {
            "description": "Account info",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tier",
                    "quotaUsed",
                    "quotaLimit",
                    "resetAt"
                  ],
                  "properties": {
                    "tier": {
                      "type": "string",
                      "enum": [
                        "free",
                        "starter",
                        "pro",
                        "scale"
                      ]
                    },
                    "quotaUsed": {
                      "type": "integer",
                      "example": 1247
                    },
                    "quotaLimit": {
                      "type": "integer",
                      "example": 10000
                    },
                    "resetAt": {
                      "type": "string",
                      "example": "2026-05-25",
                      "description": "Date the monthly quota refills (anchored to signup day-of-month)"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "fed_live_<24chars>",
        "description": "API key issued at https://fitexercisedb.com/en/login. Format: `fed_live_` + 24 base62 chars. Sent as `Authorization: Bearer fed_live_…`."
      }
    },
    "parameters": {
      "ExerciseId": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "4-digit zero-padded exercise ID, e.g. 0001",
        "schema": {
          "type": "string",
          "pattern": "^[0-9]{4}$",
          "example": "0001"
        }
      },
      "Page": {
        "name": "page",
        "in": "query",
        "description": "1-indexed page number",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "default": 1
        }
      },
      "PageSize": {
        "name": "pageSize",
        "in": "query",
        "description": "Items per page (max 100)",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 50
        }
      },
      "Lang": {
        "name": "lang",
        "in": "query",
        "description": "Response language. en · fr · es · pt · zh · ja. Falls back to Accept-Language header, then English.",
        "schema": {
          "type": "string",
          "enum": [
            "en",
            "fr",
            "es",
            "pt",
            "zh",
            "ja"
          ]
        }
      }
    },
    "schemas": {
      "Exercise": {
        "type": "object",
        "required": [
          "id",
          "name",
          "bodyPart",
          "target",
          "equipment"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "0001"
          },
          "name": {
            "type": "string",
            "example": "3/4 Sit-up"
          },
          "bodyPart": {
            "type": "string",
            "example": "Waist"
          },
          "target": {
            "type": "string",
            "example": "Abs"
          },
          "equipment": {
            "type": "string",
            "example": "Body Weight"
          },
          "category": {
            "type": "string",
            "nullable": true,
            "example": "strength"
          },
          "difficulty": {
            "type": "string",
            "nullable": true,
            "example": "beginner"
          },
          "mechanic": {
            "type": "string",
            "nullable": true,
            "example": "isolation"
          },
          "force": {
            "type": "string",
            "nullable": true,
            "example": "push"
          },
          "met": {
            "type": "number",
            "nullable": true,
            "example": 3.5
          },
          "caloriesPerMinute": {
            "type": "number",
            "nullable": true,
            "example": 4.3
          },
          "averageCaloriesPerMinute": {
            "type": "number",
            "nullable": true,
            "example": 4.3
          },
          "averageCaloriesPerHour": {
            "type": "number",
            "nullable": true,
            "example": 258
          },
          "secondaryMuscles": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            },
            "example": [
              "Hip Flexors",
              "Lower Back"
            ]
          },
          "instructions": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            }
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "fr",
              "es",
              "pt",
              "zh",
              "ja"
            ]
          }
        }
      },
      "ExerciseLinks": {
        "type": "object",
        "properties": {
          "self": {
            "type": "object",
            "properties": {
              "href": {
                "type": "string"
              }
            }
          },
          "related": {
            "type": "object",
            "properties": {
              "href": {
                "type": "string"
              }
            }
          },
          "calories": {
            "type": "object",
            "properties": {
              "href": {
                "type": "string"
              },
              "templated": {
                "type": "boolean",
                "example": true
              }
            }
          },
          "marketplacePreview": {
            "type": "object",
            "properties": {
              "href": {
                "type": "string"
              }
            }
          }
        }
      },
      "ExerciseWithLinks": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Exercise"
          },
          {
            "type": "object",
            "properties": {
              "_links": {
                "$ref": "#/components/schemas/ExerciseLinks"
              }
            }
          }
        ]
      },
      "Pagination": {
        "type": "object",
        "required": [
          "page",
          "pageSize",
          "total",
          "totalPages"
        ],
        "properties": {
          "page": {
            "type": "integer",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "example": 50
          },
          "total": {
            "type": "integer",
            "example": 1324
          },
          "totalPages": {
            "type": "integer",
            "example": 27
          }
        }
      },
      "ExerciseListResponse": {
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Exercise"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "WorkoutSummary": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "level",
          "durationMinutes",
          "category"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "level": {
            "type": "string",
            "enum": [
              "beginner",
              "intermediate",
              "advanced"
            ]
          },
          "durationMinutes": {
            "type": "integer"
          },
          "category": {
            "type": "string",
            "enum": [
              "push",
              "pull",
              "legs",
              "full_body",
              "core",
              "hiit",
              "cardio",
              "recovery"
            ]
          },
          "equipmentNeeded": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "WorkoutExercise": {
        "type": "object",
        "required": [
          "position",
          "exerciseId",
          "name",
          "bodyPart",
          "target",
          "equipment"
        ],
        "properties": {
          "position": {
            "type": "integer"
          },
          "exerciseId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "bodyPart": {
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "equipment": {
            "type": "string"
          },
          "sets": {
            "type": "integer",
            "nullable": true
          },
          "reps": {
            "type": "integer",
            "nullable": true
          },
          "restSeconds": {
            "type": "integer",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Workout": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WorkoutSummary"
          },
          {
            "type": "object",
            "required": [
              "exercises"
            ],
            "properties": {
              "exercises": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/WorkoutExercise"
                }
              }
            }
          }
        ]
      },
      "WorkoutListResponse": {
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkoutSummary"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "ProgramSummary": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "weeks",
          "level",
          "goal",
          "daysPerWeek"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "weeks": {
            "type": "integer"
          },
          "level": {
            "type": "string",
            "enum": [
              "beginner",
              "intermediate",
              "advanced"
            ]
          },
          "goal": {
            "type": "string",
            "enum": [
              "strength",
              "hypertrophy",
              "fat_loss",
              "endurance",
              "mobility"
            ]
          },
          "daysPerWeek": {
            "type": "integer"
          }
        }
      },
      "ProgramScheduleEntry": {
        "type": "object",
        "required": [
          "week",
          "day",
          "workout"
        ],
        "properties": {
          "week": {
            "type": "integer"
          },
          "day": {
            "type": "integer"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "workout": {
            "$ref": "#/components/schemas/WorkoutSummary"
          }
        }
      },
      "Program": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProgramSummary"
          },
          {
            "type": "object",
            "required": [
              "schedule"
            ],
            "properties": {
              "schedule": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ProgramScheduleEntry"
                }
              }
            }
          }
        ]
      },
      "ProgramListResponse": {
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProgramSummary"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "Problem": {
        "type": "object",
        "description": "RFC 7807 problem details",
        "required": [
          "type",
          "title",
          "status"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "example": "https://fitexercisedb.com/errors/not-found"
          },
          "title": {
            "type": "string",
            "example": "Exercise not found"
          },
          "status": {
            "type": "integer",
            "example": 404
          },
          "detail": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid request",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing or invalid API key",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "Resource exists but is missing required fields for the operation",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit or quota exceeded",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            },
            "description": "Seconds until the next allowed request"
          }
        }
      }
    }
  }
}