# List workout logs

`GET https://api.coach-platform.com/api/public/workout-logs`

List workout logs for a single trainee. traineeId is required.

- Resource: Workout Logs
- Authentication: API key in the `Authorization: Bearer cp_live_...` header
- HTML version: https://www.coach-platform.com/docs/api/reference/get-workout-logs
- OpenAPI spec: https://www.coach-platform.com/openapi.json

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. |
| `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. |
| `traineeId` | string | Yes |   |
| `from` | string | No | ISO date — earliest workoutDate |
| `to` | string | No | ISO date — latest workoutDate |

## Responses

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

### 200 OK

Content type: `application/json`

| Field | Type | Description |
|---|---|---|
| `data` | object[] |   |
| `data[].id` | string |   |
| `data[].workout` | string | Id of the workout day this log belongs to. |
| `data[].workoutName` | string |   |
| `data[].completedAt` | string | When the workout was completed. |
| `data[].totalVolume` | number |   |
| `data[].totalSets` | number |   |
| `data[].duration` | number |   |
| `data[].exerciseCount` | number |   |
| `data[].personalRecords` | object[] |   |
| `pagination` | object |   |
| `pagination.page` | number |   |
| `pagination.limit` | number |   |
| `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. |
| `pagination.hasMore` | boolean |   |
| `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. |

Example:

```json
{
  "data": [
    {
      "id": "<string>",
      "workout": "<string>",
      "workoutName": "<string>",
      "completedAt": "<string>",
      "totalVolume": 123,
      "totalSets": 123,
      "duration": 123,
      "exerciseCount": 123,
      "personalRecords": [
        {}
      ]
    }
  ],
  "pagination": {
    "page": 123,
    "limit": 123,
    "total": 123,
    "hasMore": true,
    "truncated": true
  }
}
```

### Error responses 400, 401, 403, 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 GET \
  --url 'https://api.coach-platform.com/api/public/workout-logs?traineeId=<traineeId>' \
  --header 'Authorization: Bearer cp_live_...'
```

### JavaScript (fetch)

```js
const response = await fetch('https://api.coach-platform.com/api/public/workout-logs?traineeId=<traineeId>', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer cp_live_...',
  },
});

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

## Related endpoints

- [List a trainee's exercise notes](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-exercise-notes/index.md): `GET /api/public/trainees/{traineeId}/exercise-notes`. Per-exercise notes and video replies from a trainee's workout logs.
- Previous: [Duplicate a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans-plan-id-duplicate/index.md): `POST /api/public/training-plans/{planId}/duplicate`. Copy an existing training plan, including every exercise detail (per-set prescriptions, supersets, tempo, intensity, drop sets, alternatives).
- Next: [List a trainee's exercise notes](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-exercise-notes/index.md): `GET /api/public/trainees/{traineeId}/exercise-notes`. Per-exercise notes and video replies from a trainee's workout logs.
