---
# System prepended metadata

title: Workout program/series

---

# Workout program/series

A series consists of 0 or more classes and 0 or more workout plans

-	`POST` to `/workout-program`
    -    The `index field `

```json
{
    "title": "Series Title",
    "classes": [ // list of classes in the series -- don't have to be in order, the index field determines that
        {
            "id": 1, // class id
            "index": 1, // which index in the series the class is
        },
        {
            "id": 100,
            "index": 3,
        },
        // ...
    ],
    "workoutPlans": [
        {
            "id": 1002,
            "index": 2, // which index in the series this workout plan is
        },
        {
            "id": 1003,
            "index": 4,
        }
    ]
}
```

-	`PUT` to `/workout-program?id=<program_id>`

```json
{
    "id": <series_id>,
    "classes": [
        {
            "id": 1050,
            "index": 4,
        },
        {
            "id": 1010,
            "index": 5",
        },
        // rest of the classes to add to the series
    ]
}
```

-	`GET` on `/class-series?id=<series_id>`
    -	basically the same data structure as POST, but with `id` fields for the series + classes


```json
{
    "id": <series_id>,
    "title": "Series Title",
    [
      "class": {
          "index": 1,
          "data": {
              "id": <class_id>,
              // ... rest of the class data, same as we normally return on /class GET
            }
        },
        // ... rest of the classes in the series
    ]
}
```