# Change the coach's global settings for one exercise, the same…

`PATCH https://api.coach-platform.com/api/public/exercises/{exerciseId}/settings`

Change the coach's global settings for one exercise, the same settings as the exercise library in the dashboard. Only supplied fields change. They apply to every training plan and every trainee that uses the exercise; to change an exercise inside one plan only, update that plan instead. To add alternatives without touching the existing ones send addAlternativeExercises; to drop specific ones send removeAlternativeExercises. alternativeExercises REPLACES the whole list ([] clears it); when that would remove existing alternatives the request is rejected with 409 CONFLICT listing them in details.removedAlternatives, and goes through only when resent with confirmRemoveAlternatives: true. An empty string clears notes or videoLink.

- Resource: Exercises
- Authentication: API key in the `Authorization: Bearer cp_live_...` header
- HTML version: https://www.coach-platform.com/docs/api/reference/patch-exercises-exercise-id-settings
- OpenAPI spec: https://www.coach-platform.com/openapi.json

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `exerciseId` | string | Yes | Exercise catalog id from GET /exercises. |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. |

## Request body

Content type: `application/json`. Required.

| Field | Type | Required | Description |
|---|---|---|---|
| `notes` | string | No | Coach notes shown to trainees on this exercise. Empty string clears. Maximum length: `2000`. |
| `videoLink` | string | No | Demonstration video URL (http/https). Empty string clears. Maximum length: `2000`. |
| `mediaDisplay` | string | No | "gif" shows the GIF (tapping it opens the video); "thumbnail" shows the YouTube thumbnail instead and needs a YouTube videoLink. Allowed values: `gif`, `thumbnail`. |
| `trackRm1` | boolean | No | Track an estimated 1RM (Brzycki) for this exercise. |
| `isFavorite` | boolean | No | Mark or unmark as a coach favorite. |
| `addAlternativeExercises` | string[] | No | Exercise ids (from GET /exercises) to add to the current default alternatives. Existing alternatives are kept. Maximum items: `50`. |
| `removeAlternativeExercises` | string[] | No | Exercise ids to remove from the current default alternatives. The rest are kept. Maximum items: `50`. |
| `alternativeExercises` | string[] | No | Full list of default alternative exercise ids. Replaces the current list; [] clears it. Removing existing alternatives this way needs confirmRemoveAlternatives: true. Cannot be combined with addAlternativeExercises / removeAlternativeExercises. Maximum items: `50`. |
| `confirmRemoveAlternatives` | boolean | No | Confirms that alternativeExercises may remove existing alternatives. Send only after the coach approved the removal. |

## Responses

| Status | Description |
|---|---|
| `200` OK | Successful response |
| `400` Bad Request |  |
| `401` Unauthorized |  |
| `403` Forbidden |  |
| `404` Not Found |  |
| `409` Conflict |  |
| `429` Too Many Requests |  |
| `500` Internal Server Error |  |

### 200 OK

Content type: `application/json`

| Field | Type | Description |
|---|---|---|
| `data` | object | The coach's own settings for one catalog exercise. They apply to every training plan and every trainee that uses the exercise. |
| `data.exerciseId` | string |   |
| `data.name` | string \| null |   |
| `data.nameHebrew` | string \| null |   |
| `data.isCustom` | boolean | True for an exercise the coach added to their own catalog. |
| `data.notes` | string \| null | Coach notes shown to trainees on this exercise. |
| `data.videoLink` | string \| null | Coach demonstration video URL. |
| `data.mediaDisplay` | string | How the exercise is shown to trainees: "gif" shows the GIF (tapping it opens the video), "thumbnail" shows the YouTube video thumbnail instead of the GIF. Allowed values: `gif`, `thumbnail`. |
| `data.trackRm1` | boolean | Track an estimated 1RM (Brzycki) for this exercise. |
| `data.isFavorite` | boolean | Marked as a coach favorite. |
| `data.alternativeExercises` | object[] | Default alternatives trainees may swap this exercise for, in every plan. |
| `data.alternativeExercises[].exerciseId` | string |   |
| `data.alternativeExercises[].name` | string \| null |   |
| `data.alternativeExercises[].nameHebrew` | string \| null |   |

Example:

```json
{
  "data": {
    "exerciseId": "<string>",
    "name": "<string>",
    "nameHebrew": "<string>",
    "isCustom": true,
    "notes": "<string>",
    "videoLink": "<string>",
    "mediaDisplay": "gif",
    "trackRm1": true,
    "isFavorite": true,
    "alternativeExercises": [
      {
        "exerciseId": "<string>",
        "name": "<string>",
        "nameHebrew": "<string>"
      }
    ]
  }
}
```

### Error responses 400, 401, 403, 404, 409, 429, 500

Content type: `application/json`

| Field | Type | Description |
|---|---|---|
| `error` | object |   |
| `error.code` | string |   |
| `error.message` | string |   |
| `error.fix` | string \| null |   |
| `error.details` | object \| null |   |
| `error.retryAfterMs` | number \| null |   |

Example:

```json
{
  "error": {
    "code": "<string>",
    "message": "<string>",
    "fix": "<string>",
    "details": {},
    "retryAfterMs": 123
  }
}
```

## Examples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.coach-platform.com/api/public/exercises/<exerciseId>/settings' \
  --header 'Authorization: Bearer cp_live_...' \
  --header 'Content-Type: application/json' \
  --data '{
  "notes": "<string>"
}'
```

### JavaScript (fetch)

```js
const response = await fetch('https://api.coach-platform.com/api/public/exercises/<exerciseId>/settings', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer cp_live_...',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "notes": "<string>"
  }),
});

const data = await response.json();
```

## Related endpoints

- [Search the exercise catalog](https://www.coach-platform.com/docs/api/reference/get-exercises/index.md): `GET /api/public/exercises`. Search the exercises catalog (name, muscle group).
- [List the exercises the coach has configured](https://www.coach-platform.com/docs/api/reference/get-exercises-settings/index.md): `GET /api/public/exercises/settings`. List the exercises the coach has configured: coach notes, demonstration video, media display, 1RM tracking, favorite and the default alternatives trainees may swap to.
- [The coach's global settings for one exercise](https://www.coach-platform.com/docs/api/reference/get-exercises-exercise-id-settings/index.md): `GET /api/public/exercises/{exerciseId}/settings`. The coach's global settings for one exercise.
- Previous: [The coach's global settings for one exercise](https://www.coach-platform.com/docs/api/reference/get-exercises-exercise-id-settings/index.md): `GET /api/public/exercises/{exerciseId}/settings`. The coach's global settings for one exercise.
- Next: [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged.
