---
title: "Create an absence policy"
method: POST
path: "/companies/{company}/absence-policies"
tags: ["Absence Policies"]
---

# Create an absence policy

`POST /companies/{company}/absence-policies`

## Request

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

Create an absence policy for the company resolved from the API key; returns it with its generated `id` (UUID v7).
- Required: `name`, `allowance_type` (`limited`/`unlimited`), `accrual_method` (`annual`/`monthly`); `allowance_days` is required and positive only when `limited`.
- `absence_type_ids` lists covered types (may be empty); a type of another company returns 422.

## Path parameters

- `company` string, uuid, required

## Headers

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

## Request body

- CreateAbsencePolicyRequest
  - `name` string, required: Absence policy name.
  - `allowance_type` 'limited' | 'unlimited', required: Day allowance type: `limited` or `unlimited`.
  - `allowance_days` integer, nullable: Days allotted per year (required and positive only when the allowance is `limited`).
  - `accrual_method` 'annual' | 'monthly', required: Day accrual method: `annual` or `monthly`.
  - `absence_type_ids` string[], required: Absence type IDs (UUID v7) associated with the policy (may be empty).

## Response `201`

Absence policy created. The `Location` header contains the canonical URL of the new absence policy.

- object
  - `data` AbsencePolicy, required: An absence policy for the Control Horario (time tracking) module: how many days per year an employee accrues for a set of absence types, how those days accrue, and which employees it applies to. `allowance_type` decides whether the yearly allowance is capped (`limited`, with `allowance_days`) or `unlimited`.
    - `id` string, uuid, required: Opaque identifier of the policy, a UUID v7.
    - `object` 'absence_policy', required: Always `absence_policy`.
    - `name` string, required: Human-readable name of the policy (e.g. `Vacaciones estándar`).
    - `allowance_type` 'limited' | 'unlimited', required: Whether the yearly allowance is capped (`limited`) or `unlimited`.
    - `allowance_days` integer, nullable, required: Days accrued per year when `allowance_type` is `limited`; `null` when `unlimited`.
    - `accrual_method` 'annual' | 'monthly', required: How the allowance accrues: `annual` (all at once) or `monthly` (prorated).
    - `absence_type_ids` string[], required: UUID v7 of each absence type this policy covers.
    - `assigned_employee_count` integer, required: Number of employees currently assigned to the policy.
    - `status` 'active' | 'archived', required: Lifecycle status: `active` (usable) or `archived` (retired from use).
    - `carryover` object, required: How much unused balance carries over at year-end under this policy.
      - `type` 'none' | 'capped' | 'unlimited', required: Carryover mode: `none` (no carryover), `capped` (up to `max_days`) or `unlimited`.
      - `max_days` integer, nullable, required: Maximum days that carry over when `type` is `capped`; `null` otherwise.
      - `expiry_month` integer, nullable, required: Month (1..12) on which carried-over days expire, or `null` when they do not expire.
      - `expiry_day` integer, nullable, required: Day of month on which carried-over days expire, or `null` when they do not expire.
    - `created_at` string, date-time, nullable, required: Creation timestamp (ISO 8601).
    - `updated_at` string, date-time, nullable, required: Last-update timestamp (ISO 8601).

## 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_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)
