# Employee Endpoints {#employee-endpoints}


API endpoints for employee management, profiles, and statistics.


## Employee CRUD {#employee-crud}



### List Employees {#list-employees}


```http
GET /api/employee?take=10&skip=0&relations[]=user&relations[]=organization
Authorization: Bearer {token}
```

**Response (200 OK):**

```json
{
  "items": [
    {
      "id": "...",
      "firstName": "John",
      "lastName": "Doe",
      "billRateValue": 50,
      "billRateCurrency": "USD",
      "startedWorkOn": "2024-01-01T00:00:00.000Z",
      "isActive": true,
      "user": { "id": "...", "email": "john@example.com" },
      "organization": { "id": "...", "name": "Engineering" }
    }
  ],
  "total": 42
}
```


### Get Employee by ID {#get-employee-by-id}


```http
GET /api/employee/{id}
Authorization: Bearer {token}
```


### Create Employee {#create-employee}


```http
POST /api/employee
Authorization: Bearer {token}
Content-Type: application/json

{
  "firstName": "John",
  "lastName": "Doe",
  "startedWorkOn": "2024-01-01",
  "billRateValue": 50,
  "billRateCurrency": "USD",
  "userId": "user-uuid",
  "organizationId": "org-uuid"
}
```


### Update Employee {#update-employee}


```http
PUT /api/employee/{id}
Authorization: Bearer {token}
Content-Type: application/json

{
  "firstName": "John",
  "lastName": "Updated",
  "billRateValue": 60
}
```


### Delete Employee {#delete-employee}


```http
DELETE /api/employee/{id}
Authorization: Bearer {token}
```


## Employee Statistics {#employee-statistics}



### Get Employee Statistics {#get-employee-statistics}


```http
GET /api/employee/{id}/statistics
Authorization: Bearer {token}
```

**Response:** aggregated time tracking, income, and expense data for the employee.


### Get Working Statistics {#get-working-statistics}


```http
GET /api/employee/statistics/months
Authorization: Bearer {token}
```

Returns monthly aggregated working hours, income, and bonuses.


## Employee Levels {#employee-levels}



### List Employee Levels {#list-employee-levels}


```http
GET /api/employee-level
Authorization: Bearer {token}
```


### Create Employee Level {#create-employee-level}


```http
POST /api/employee-level
Authorization: Bearer {token}
Content-Type: application/json

{
  "level": "Senior Developer",
  "organizationId": "org-uuid"
}
```


## Employee Awards {#employee-awards}



### List Awards {#list-awards}


```http
GET /api/employee-award?where[employeeId]={employee-id}
Authorization: Bearer {token}
```


### Create Award {#create-award}


```http
POST /api/employee-award
Authorization: Bearer {token}
Content-Type: application/json

{
  "name": "Employee of the Month",
  "year": "2024",
  "employeeId": "employee-uuid",
  "organizationId": "org-uuid"
}
```


## Employee Settings {#employee-settings}



### Get Employee Settings {#get-employee-settings}


```http
GET /api/employee-setting?where[employeeId]={employee-id}
Authorization: Bearer {token}
```


### Update Employee Settings {#update-employee-settings}


```http
PUT /api/employee-setting/{id}
Authorization: Bearer {token}
Content-Type: application/json

{
  "isTrackingEnabled": true,
  "isScreenshotEnabled": true,
  "screenshotFrequency": 10,
  "trackOnSleep": false
}
```


## Employee Recurring Expenses {#employee-recurring-expenses}



### List Recurring Expenses {#list-recurring-expenses}


```http
GET /api/employee-recurring-expense?where[employeeId]={employee-id}
Authorization: Bearer {token}
```


### Create Recurring Expense {#create-recurring-expense}


```http
POST /api/employee-recurring-expense
Authorization: Bearer {token}
Content-Type: application/json

{
  "employeeId": "employee-uuid",
  "categoryName": "Internet",
  "value": 50,
  "currency": "USD",
  "startDate": "2024-01-01",
  "organizationId": "org-uuid"
}
```


## Required Permissions {#required-permissions}


| Endpoint                           | Permission       |
| ---------------------------------- | ---------------- |
| `GET /api/employee`                | `EMPLOYEES_VIEW` |
| `POST /api/employee`               | `EMPLOYEES_EDIT` |
| `PUT /api/employee/:id`            | `EMPLOYEES_EDIT` |
| `DELETE /api/employee/:id`         | `EMPLOYEES_EDIT` |
| `GET /api/employee/:id/statistics` | `EMPLOYEES_VIEW` |
