---
title: "Close a monthly time record"
method: POST
path: "/companies/{company}/monthly-time-record-closes"
tags: ["Monthly Register Closes"]
---

# Close a monthly time record

`POST /companies/{company}/monthly-time-record-closes`

## Request

- Base URL: `https://api.factuarea.com/v1`
- URL: `https://api.factuarea.com/v1/companies/{company}/monthly-time-record-closes`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Freeze the immutable monthly close of the time record register for a finished `(year, month)`.
- Snapshots balances and absences of every employee in the period and locks it against retroactive entries.
- A month not yet ended returns 422; an already closed period returns 409.
- Returns 201 with the close and a `Location` header.

## Path parameters

- `company` string, uuid, required

## Headers

- `Idempotency-Key` string
- `Factuarea-Version` string, date

## Request body

- CloseMonthlyTimeRecordRequest
  - `year` integer, required: Year of the period to close (YYYY).
  - `month` integer, required: Month of the period to close (1-12).

## Response `201`

Month closed. The `Location` header contains the canonical URL of the new monthly close.

- object
  - `data` MonthlyTimeRecordClose, required: An immutable monthly close of the time record register for the Control Horario (time tracking) module. Closing a finished `(year, month)` freezes each active employee’s balance snapshot and locks the period against retroactive entries and corrections. The close can be reopened for an audited correction (state `closed ⇄ reopened`).
    - `id` string, uuid, required: Opaque identifier of the monthly close, a UUID v7 (e.g. `01931b3e-7c4a-7f2e-9a8b-3c5d6e7f8a9b`).
    - `object` 'monthly_time_record_close', required: Always `monthly_time_record_close`.
    - `year` integer, required: Year of the closed period.
    - `month` integer, required: Month of the closed period (1-12).
    - `status` 'closed' | 'reopened', required: State of the close: `closed` (immutable, period locked) or `reopened` (writes re-enabled for a correction).
    - `period_start` string, date, required: First day of the closed period (YYYY-MM-DD).
    - `period_end` string, date, required: Last day of the closed period (YYYY-MM-DD).
    - `closed_by_id` string, uuid, required: UUID v7 of the user who closed the period.
    - `closed_at` string, date-time, required: When the period was closed (ISO 8601).
    - `reopened_by_id` string, uuid, nullable, required: UUID v7 of the user who reopened the close; `null` while it is still `closed`.
    - `reopened_at` string, date-time, nullable, required: When the close was reopened (ISO 8601); `null` while it is still `closed`.
    - `employee_count` integer, required: Number of employees included in the close.
    - `is_sealed` boolean, required: Whether a digital seal exists for this close (mere presence; integrity verification is served by `GET /companies/{company}/monthly-time-record-closes/{monthly_time_record_close}/seal`).

## Other responses

- `400`: `parameter_unknown` with `subcode` `retired_active_profile_header`: the retired `X-Active-Profile` header was sent; the company goes in the path. `parameter_invalid_format` on `Factuarea-Version`: the header is not a `YYYY-MM-DD` date. `unsupported_api_version`: the `Factuarea-Version` date is not a supported version.
- `401`: Missing or invalid API key.
- `403`: The request is authenticated but not allowed: the API key lacks the required scope (`insufficient_scope`), the plan does not include the public API or this feature (`addon_not_active`, `feature_not_available_in_plan`), or the module is not available with a test key (`module_not_available_in_sandbox`).
- `404`: The requested resource does not exist or belongs to another company. `profile_not_found`: the company in the path does not exist, is not in the API key scope or belongs to the other environment (live or test).
- `409`: The request conflicts with data that already exists or with a request running at the same time. `resource_already_exists` with `subcode` `monthly_register_already_closed`: that month of the time register is already closed. `resource_conflict`: another request was reserving identifiers for the same kind of record at that moment and this one could not complete its reservation. Nothing was written; send the request again after a few seconds.
- `422`: Validation failed. The `error.param` field identifies which input is invalid.
- `429`: Rate limit exceeded. Retry after the duration in `Retry-After`.
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/factuarea/apis/factuarea-public-api.md) · [All operations](https://skmtc.dev/factuarea/apis/factuarea-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/factuarea/apis/factuarea-public-api/revisions/718e77934422?raw)
