> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List Workforce Trainings by Employee

> Retrieve every training record belonging to one own workforce employee

[← Own Workforce API](/api-reference/own-workforce/overview)

Return the training records of a single employee. The employee id goes in the path, which is what distinguishes this from the organization-wide [List Workforce Trainings](/api-reference/own-workforce/list-trainings).

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication

  **Example:** `sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

### Path Parameters

<ParamField path="own_workforce_id" type="string" required>
  Employee UUID, from [List Workforce Employees](/api-reference/own-workforce/list)

  **Example:** `550e8400-e29b-41d4-a716-446655440000`
</ParamField>

## Response

A bare JSON array of training records, with the same fields as [List Workforce Trainings](/api-reference/own-workforce/list-trainings). An employee with no trainings returns an empty array, not a 404.

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET "https://api.dcycle.io/v1/own_workforce_trainings/own_workforce/550e8400-e29b-41d4-a716-446655440000" \
    -H "x-api-key: ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import os

  import requests

  headers = {
      "x-api-key": os.getenv("DCYCLE_API_KEY"),
      "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
  }

  employee_id = "550e8400-e29b-41d4-a716-446655440000"
  response = requests.get(
      f"https://api.dcycle.io/v1/own_workforce_trainings/own_workforce/{employee_id}",
      headers=headers,
  )

  records = response.json()
  print(f"{len(records)} trainings, {sum(r['hours'] for r in records)} hours")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const axios = require('axios');

  const headers = {
    'x-api-key': process.env.DCYCLE_API_KEY,
    'x-organization-id': process.env.DCYCLE_ORG_ID
  };

  const employeeId = '550e8400-e29b-41d4-a716-446655440000';

  axios.get(`https://api.dcycle.io/v1/own_workforce_trainings/own_workforce/${employeeId}`, { headers })
    .then(({ data }) => {
      const hours = data.reduce((total, record) => total + record.hours, 0);
      console.log(`${data.length} trainings, ${hours} hours`);
    })
    .catch(error => console.error(error));
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
[
  {
    "id": "3d9b0a11-2c4e-4f6a-8b1d-5e7f9a0c2d4e",
    "own_workforce_id": "550e8400-e29b-41d4-a716-446655440000",
    "external_employee_id": "EMP-2024-001",
    "type": "Health and safety",
    "description": "Annual fire safety refresher",
    "hours": 4.0,
    "start_date": "2026-03-02",
    "end_date": "2026-03-02",
    "file_id": "aa11bb22-cc33-4d44-8e55-ff6677889900",
    "file_name": "trainings_2026.csv",
    "status": "active",
    "custom_values": {}
  }
]
```

## Common Errors

### 401 Unauthorized

**Cause:** the key is invalid, or it does not belong to the organization in `x-organization-id` — the two are looked up as a pair. A request carrying no credentials at all answers `AUTH_REQUIRED` instead.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Invalid API key for organization",
  "code": "INVALID_API_KEY"
}
```

### 403 Forbidden

**Cause:** the key's owner is not an enabled member of the organization in `x-organization-id`.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Logged User is not Member of Organization",
  "code": "LOGGED_USER_NOT_MEMBER"
}
```

### 404 Not Found

**Cause:** no employee with that id inside your perimeter. An employee owned by another organization answers 404, the same as one that does not exist.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "code": "NOT_FOUND",
  "detail": "OwnWorkforceModel with id='550e8400-e29b-41d4-a716-446655440000' not found"
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Get employee" icon="user" href="/api-reference/own-workforce/get">
    The person these trainings belong to
  </Card>

  <Card title="Absences of an employee" icon="notes-medical" href="/api-reference/own-workforce/list-absences-by-employee">
    The same view for absences and accidents
  </Card>
</CardGroup>
