## The people and units the signed-in user is responsible for

`GET /api/hr/v1/me/team`

Module: HR · operationId: `getMyTeam` · Tag: Organisation · Auth: access token (`Authorization: Bearer <accessToken>`)

### Responses

- **200** Team (`application/json`)

Fields of the 200 answer:

- `directReports` (array of string): Ids of the people whose direct manager the caller is
- `members` (array of PersonRef): People the caller is responsible for (direct and indirect)
  - `displayName` (string): Display name of the employee
  - `email` (string): E-mail address of the employee
  - `id` (string): Id of the employee
- `units` (array of OrgUnit): Units the caller heads or deputises for
  - `name` (string, required): Name of the unit (max length 120)
  - `archived` (boolean): Archived: no longer offered for new data, kept for existing data
  - `deputyId` (string): Stands in for the head (decides while the head is away)
  - `headId` (string): Employee who leads the unit (direct manager of its members)
  - `id` (string, read-only): Id of the org unit
  - `memberCount` (integer, read-only): Active employees placed directly in the unit
  - `parentId` (string): Empty = top level
  - `sortOrder` (integer): Position in lists (ascending)
  - `version` (integer): Version for optimistic locking: send the version you read with a change (stale: 409 version_conflict)

Example 200 answer:

```json
{
  "directReports": [
    "e5a1c3d7-2b4f-4c6e-8a0b-1d3f5b7c9e02",
    "c7e9a1b3-5d7f-4b2c-8e4a-6f8b0d2c4e06",
    "d1f3b5c7-9e1a-4d3f-8b5c-7a9e1f3b5d08",
    "0a2c4e6a-8c0e-4a2c-9e4a-6c8e0a2c4e19"
  ],
  "members": [
    {
      "displayName": "Sophie Huber",
      "email": "sophie.huber@muster-it.example",
      "id": "e5a1c3d7-2b4f-4c6e-8a0b-1d3f5b7c9e02"
    },
    {
      "displayName": "Elias Gruber",
      "email": "elias.gruber@muster-it.example",
      "id": "c7e9a1b3-5d7f-4b2c-8e4a-6f8b0d2c4e06"
    },
    {
      "displayName": "Hannah Lehner",
      "email": "hannah.lehner@muster-it.example",
      "id": "d1f3b5c7-9e1a-4d3f-8b5c-7a9e1f3b5d08"
    },
    {
      "displayName": "Noah Fischer",
      "email": "noah.fischer@muster-it.example",
      "id": "0a2c4e6a-8c0e-4a2c-9e4a-6c8e0a2c4e19"
    }
  ],
  "units": [
    {
      "archived": false,
      "deputyId": "e5a1c3d7-2b4f-4c6e-8a0b-1d3f5b7c9e02",
      "headId": "b2d4f6a8-0c1e-4a3b-9d5f-7e9a1c3b5d04",
      "id": "0c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a71",
      "memberCount": 4,
      "name": "Service Desk",
      "parentId": "2e4a6c8e-0a2c-4e4a-8c6e-0a2c4e6a8c72",
      "sortOrder": 10,
      "version": 2
    }
  ]
}
```

### Example request

```bash
curl -X GET 'https://api.mbcom.cloud/api/hr/v1/me/team' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
