{
 "openapi": "3.0.3",
 "info": {
  "title": "Totality Exercise API",
  "version": "1.0.0",
  "description": "750+ exercises written in plain English to one coaching standard, with setup steps, coaching cues, common mistakes, rep ranges, muscles, equipment, easier and harder versions, and Totality's own animated videos. Get a free sandbox key at https://totality360.com.au/api. Terms: https://totality360.com.au/api-terms",
  "contact": {
   "name": "Totality 360 Pty Ltd",
   "url": "https://totality360.com.au/api",
   "email": "taj@totality360.com.au"
  },
  "termsOfService": "https://totality360.com.au/api-terms"
 },
 "servers": [
  {
   "url": "https://spqazfyxxhzizbtmxklr.supabase.co/functions/v1/exercise-api"
  }
 ],
 "security": [
  {
   "bearerAuth": []
  }
 ],
 "tags": [
  {
   "name": "Exercises"
  },
  {
   "name": "Account"
  }
 ],
 "paths": {
  "/v1/exercises": {
   "get": {
    "summary": "List exercises",
    "description": "Filter by muscle group, equipment, difficulty, goal and name. Sandbox keys see 50 sample exercises without video.",
    "tags": [
     "Exercises"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Exercise"
           }
          },
          "limit": {
           "type": "integer"
          },
          "offset": {
           "type": "integer"
          },
          "count": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "muscle",
      "in": "query",
      "required": false,
      "description": "Muscle group, comma separated, for example quads,glutes",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "equipment",
      "in": "query",
      "required": false,
      "description": "Equipment, comma separated, for example Dumbbell",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "difficulty",
      "in": "query",
      "required": false,
      "description": "beginner, intermediate or advanced",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "goal",
      "in": "query",
      "required": false,
      "description": "strength, hypertrophy, endurance, mobility, rehabilitation, power or cardio",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "Name search",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "1 to 100, default 25",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "offset",
      "in": "query",
      "required": false,
      "description": "For paging",
      "schema": {
       "type": "integer"
      }
     }
    ]
   }
  },
  "/v1/exercises/{id}": {
   "get": {
    "summary": "Get one exercise",
    "description": "Includes a signed 1 hour animated video link when the exercise has one and your plan includes video.",
    "tags": [
     "Exercises"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Exercise"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "zercher-squat"
     }
    ]
   }
  },
  "/v1/exercises/{id}/alternatives": {
   "get": {
    "summary": "Alternatives",
    "description": "Up to 10 exercises that train the same main muscle group, nearest difficulty first.",
    "tags": [
     "Exercises"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Exercise"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "zercher-squat"
     }
    ]
   }
  },
  "/v1/muscles": {
   "get": {
    "summary": "Muscle groups",
    "description": "Every value the muscle filter accepts.",
    "tags": [
     "Exercises"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/equipment": {
   "get": {
    "summary": "Equipment",
    "description": "Every value the equipment filter accepts.",
    "tags": [
     "Exercises"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/changes": {
   "get": {
    "summary": "Change feed",
    "description": "Exercises added or changed since a date. Studio and Licence plans.",
    "tags": [
     "Exercises"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "updated_at": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "since",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "example": "2026-11-01"
     }
    ]
   }
  },
  "/v1/usage": {
   "get": {
    "summary": "Usage",
    "description": "Your plan and calls used this month.",
    "tags": [
     "Account"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "plan": {
           "type": "string"
          },
          "used": {
           "type": "integer"
          },
          "limit": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/keys": {
   "post": {
    "summary": "Get a free sandbox key",
    "description": "Emails a sandbox key and returns it once.",
    "tags": [
     "Account"
    ],
    "security": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "email"
        ],
        "properties": {
         "email": {
          "type": "string",
          "format": "email"
         },
         "label": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "key": {
           "type": "string"
          },
          "plan": {
           "type": "string"
          },
          "note": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearerAuth": {
    "type": "http",
    "scheme": "bearer",
    "description": "Your key, starting tx_live_"
   }
  },
  "schemas": {
   "Exercise": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "example": "zercher-squat"
     },
     "name": {
      "type": "string"
     },
     "description": {
      "type": "string"
     },
     "difficulty": {
      "type": "string",
      "enum": [
       "beginner",
       "intermediate",
       "advanced"
      ]
     },
     "load_type": {
      "type": "string"
     },
     "equipment": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "muscles": {
      "type": "object",
      "properties": {
       "primary": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "secondary": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "groups": {
        "type": "array",
        "items": {
         "type": "string"
        }
       }
      }
     },
     "setup_steps": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "coaching_cues": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "common_mistakes": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "form_summary": {
      "type": "string"
     },
     "why_it_works": {
      "type": "string"
     },
     "rep_ranges": {
      "type": "string"
     },
     "goals": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "use_cases": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "easier": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Ids of easier versions"
     },
     "harder": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Ids of harder versions"
     },
     "has_video": {
      "type": "boolean"
     },
     "video": {
      "nullable": true,
      "type": "object",
      "properties": {
       "type": {
        "type": "string",
        "enum": [
         "animation"
        ]
       },
       "mp4": {
        "type": "string",
        "format": "uri",
        "description": "Signed link, valid for 1 hour"
       },
       "expires_in": {
        "type": "integer"
       }
      }
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "type": "string"
       },
       "message": {
        "type": "string"
       }
      }
     }
    }
   }
  }
 }
}