## Close a past month (hr:time:manage, or managers for their team)

`POST /api/hr/v1/time-periods/close`

Module: HR · operationId: `closeTimePeriod` · Tag: Working time · Auth: access token (`Authorization: Bearer <accessToken>`)

Freezes the month's figures; its entries and absences can no longer change. No `employeeIds` closes it for every active employee.

### Request body

`application/json` (required)

- `month` (string, required): YYYY-MM
- `employeeIds` (array of string): Employees to close or reopen the month for; empty: every active employee

Example:

```json
{
  "employeeIds": [
    "c7e9a1b3-5d7f-4b2c-8e4a-6f8b0d2c4e06",
    "e5a1c3d7-2b4f-4c6e-8a0b-1d3f5b7c9e02"
  ],
  "month": "2026-10"
}
```

### Responses

- **200** Number of employees whose month was closed (`application/json`)
- **400** Error (`application/json`)

Fields of the 200 answer:

- `closed` (integer): Number of employees whose month was closed

Example 200 answer:

```json
{
  "closed": 2
}
```

### Example request

```bash
curl -X POST 'https://api.mbcom.cloud/api/hr/v1/time-periods/close' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"employeeIds":["c7e9a1b3-5d7f-4b2c-8e4a-6f8b0d2c4e06","e5a1c3d7-2b4f-4c6e-8a0b-1d3f5b7c9e02"],"month":"2026-10"}'
```
