---
search:
  tags:
    - Training
    - PATCH
seo:
  description: >-
    Replaces a slot's exercise from the given week on (default all unlogged
    weeks).… Reference for the PATCH /api/training/slots/{id} endpoint in the
    skcal API.
sidebar:
  label: Swap an exercise
  badge: PATCH
title: Swap an exercise
type: openapi-operation
---
Replaces a slot's exercise from the given week on (default all unlogged weeks). Logged sets keep the exercise they were done with.

`PATCH /api/training/slots/{id}`

**Request body** (`application/json`, required)

The replacement exercise, by id or name.

- `exerciseId` (string) — Id of the replacement exercise from the library.
- `exerciseName` (string) — Exercise name, matched against the library within the slot's muscle.
- `fromWeek` (integer) — First week to change (default 1, every unlogged set).

Request body example:

```json
{
  "exerciseId": "incline_dumbbell_press",
  "exerciseName": "incline dumbbell press",
  "fromWeek": 3
}
```

**Responses**

- `200` — The exercise was swapped.
- `400` — The request body or parameters failed validation.
- `404` — No matching resource owned by the caller.

Response example, 200:

```json
{
  "ok": true,
  "week": 2,
  "day": 1,
  "exerciseName": "Barbell Bench Press",
  "muscle": "chest"
}
```
