> ## Documentation Index
> Fetch the complete documentation index at: https://docs.filexpress.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Editar reglas

> Actualiza los campos enviados (`params` se reemplaza completo). Recalcula la asistencia de la vigencia.

**Permiso requerido:** `hr.labor_rules.write`



## OpenAPI

````yaml /api-reference/openapi.json put /hr/labor-rules/{id}
openapi: 3.0.3
info:
  title: FileXpress API Externa
  version: 1.0.0
  description: >-
    API para integrar sistemas de terceros con FileXpress: facturación, RRHH,
    contabilidad, inventario, proyectos, cuentas por cobrar y pagar, tesorería,
    precios y promociones y caja.
servers:
  - url: https://api.filexpress.app/api/external
    description: Producción
security:
  - ApiKey: []
tags:
  - name: General
  - name: Facturación · Ventas
  - name: Facturación · Compras
  - name: Facturación · Clientes
  - name: Facturación · Proveedores
  - name: Facturación · Productos
  - name: Catálogos
  - name: RRHH · Empleados
  - name: RRHH · Asistencia
  - name: RRHH · Reglas laborales
  - name: RRHH · Horarios
  - name: RRHH · Feriados
  - name: RRHH · Resultados de asistencia
  - name: RRHH · Permisos
  - name: RRHH · Planillas
  - name: Contabilidad
  - name: Inventario
  - name: Proyectos
  - name: Cuentas por cobrar
  - name: Cuentas por pagar
  - name: Tesorería
  - name: Precios y promociones
  - name: Caja
paths:
  /hr/labor-rules/{id}:
    put:
      tags:
        - RRHH · Reglas laborales
      summary: Editar reglas
      description: >-
        Actualiza los campos enviados (`params` se reemplaza completo).
        Recalcula la asistencia de la vigencia.


        **Permiso requerido:** `hr.labor_rules.write`
      parameters:
        - name: id
          in: path
          required: true
          description: ID del conjunto de reglas
          schema:
            type: string
            format: uuid
          example: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LaborRuleSetUpdateRequest'
            example:
              effective_to: '2026-12-31'
      responses:
        '200':
          description: Éxito
          content:
            application/json:
              example:
                status: true
                data:
                  id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
                  business_id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
                  country_code: SV
                  name: El Salvador – Código de Trabajo
                  source_template_id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
                  effective_from: '2026-01-01'
                  effective_to: '2026-12-31'
                  schema_version: 1
                  params:
                    timezone: America/El_Salvador
                    day_band:
                      start: '06:00'
                      end: '19:00'
                    mixed_rule:
                      type: night_if_night_minutes_gt
                      threshold_minutes: 240
                    max_ordinary:
                      daily:
                        day: 480
                        night: 420
                        mixed: 480
                      weekly:
                        day: 2640
                        night: 2340
                        mixed: 2640
                    week_starts_on: 1
                    default_rest_days:
                      - 7
                    default_daily_minutes:
                      '1': 480
                      '2': 480
                      '3': 480
                      '4': 480
                      '5': 480
                      '6': 240
                      '7': 0
                    overtime:
                      basis:
                        - daily
                        - weekly
                      daily_cap_minutes: null
                      weekly_cap_minutes: null
                      total_daily_cap_minutes: null
                      requires_approval: false
                    surcharges:
                      ordinary_day: 0
                      ordinary_night: 0.25
                      overtime_day: 1
                      overtime_night: 1.5
                      rest_day: 0.5
                      holiday: 1
                      combination: multiplicative
                    rest_day_compensatory: true
                    breaks:
                      paid: false
                      min_minutes: 30
                      auto_deduct_minutes: 0
                    tolerances:
                      late_grace_minutes: 5
                      early_leave_grace_minutes: 0
                      absence_after_minutes: null
                    rounding:
                      unit_minutes: 1
                      mode: none
                    min_hourly_wage: 1.7
                    currency: USD
                  is_active: true
                  is_template: false
                  recalculation_queued: true
        '401':
          $ref: '#/components/responses/E401'
        '403':
          $ref: '#/components/responses/E403'
        '404':
          $ref: '#/components/responses/E404'
        '422':
          $ref: '#/components/responses/E422'
        '429':
          $ref: '#/components/responses/E429'
components:
  schemas:
    LaborRuleSetUpdateRequest:
      type: object
      properties:
        country_code:
          type: string
          description: País (2 letras).
        name:
          type: string
        effective_from:
          type: string
          format: date
        effective_to:
          type: string
          format: date
          nullable: true
        params:
          type: object
          properties:
            timezone:
              type: string
              description: Zona horaria IANA.
            day_band:
              type: object
              properties:
                start:
                  type: string
                  pattern: ^([01]\d|2[0-3]):[0-5]\d$
                end:
                  type: string
                  pattern: ^([01]\d|2[0-3]):[0-5]\d$
              required:
                - start
                - end
            mixed_rule:
              type: object
              properties:
                type:
                  type: string
                  description: Regla de jornada mixta.
                  enum:
                    - night_if_night_minutes_gt
                    - night_if_night_minutes_gte
                    - per_hour
                threshold_minutes:
                  type: integer
                  nullable: true
              required:
                - type
            max_ordinary:
              type: object
              properties:
                daily:
                  type: object
                  properties:
                    day:
                      type: integer
                    night:
                      type: integer
                    mixed:
                      type: integer
                  required:
                    - day
                    - night
                    - mixed
                weekly:
                  type: object
                  properties:
                    day:
                      type: integer
                    night:
                      type: integer
                    mixed:
                      type: integer
                  required:
                    - day
                    - night
                    - mixed
              required:
                - daily
                - weekly
            week_starts_on:
              type: integer
              minimum: 1
              maximum: 7
            default_rest_days:
              type: array
              items:
                type: integer
                minimum: 1
                maximum: 7
            default_daily_minutes:
              type: object
              additionalProperties:
                type: integer
              description: Minutos por día ISO ("1"…"7").
            overtime:
              type: object
              properties:
                basis:
                  type: array
                  items:
                    type: string
                    enum:
                      - daily
                      - weekly
                daily_cap_minutes:
                  type: integer
                  nullable: true
                weekly_cap_minutes:
                  type: integer
                  nullable: true
                total_daily_cap_minutes:
                  type: integer
                  nullable: true
                requires_approval:
                  type: boolean
              required:
                - basis
                - requires_approval
            surcharges:
              type: object
              properties:
                ordinary_day:
                  type: number
                  description: Fracción adicional (0.25 = +25 %).
                ordinary_night:
                  type: number
                  description: Fracción adicional (0.25 = +25 %).
                overtime_day:
                  type: number
                  description: Fracción adicional (0.25 = +25 %).
                overtime_night:
                  type: number
                  description: Fracción adicional (0.25 = +25 %).
                rest_day:
                  type: number
                  description: Fracción adicional (0.25 = +25 %).
                holiday:
                  type: number
                  description: Fracción adicional (0.25 = +25 %).
                combination:
                  type: string
                  description: Combinación de recargos.
                  enum:
                    - additive
                    - multiplicative
              required:
                - combination
            rest_day_compensatory:
              type: boolean
            breaks:
              type: object
              properties:
                paid:
                  type: boolean
                min_minutes:
                  type: integer
                auto_deduct_minutes:
                  type: integer
              required:
                - paid
                - min_minutes
                - auto_deduct_minutes
            tolerances:
              type: object
              properties:
                late_grace_minutes:
                  type: integer
                early_leave_grace_minutes:
                  type: integer
                absence_after_minutes:
                  type: integer
                  nullable: true
              required:
                - late_grace_minutes
                - early_leave_grace_minutes
            rounding:
              type: object
              properties:
                unit_minutes:
                  type: integer
                  minimum: 1
                  maximum: 60
                mode:
                  type: string
                  description: Modo.
                  enum:
                    - none
                    - floor
                    - ceil
                    - nearest
              required:
                - unit_minutes
                - mode
            min_hourly_wage:
              type: number
              nullable: true
            currency:
              type: string
              description: Moneda ISO de 3 letras.
          required:
            - timezone
            - day_band
            - mixed_rule
            - max_ordinary
            - week_starts_on
            - default_rest_days
            - default_daily_minutes
            - overtime
            - surcharges
            - rest_day_compensatory
            - breaks
            - tolerances
            - rounding
            - currency
        is_active:
          type: boolean
  responses:
    E401:
      description: API Key ausente o inválida
      content:
        application/json:
          example:
            status: false
            message: Invalid API Key.
    E403:
      description: Integración sin el permiso requerido o desactivada
      content:
        application/json:
          example:
            status: false
            message: This integration does not have the 'hr.employees' permission.
            required_scope: hr.employees
    E404:
      description: Recurso inexistente o de otro negocio
      content:
        application/json:
          example:
            status: false
            message: Not found.
    E422:
      description: Error de validación
      content:
        application/json:
          example:
            status: false
            message: Validation errors
            errors:
              start_date:
                - The start date field is required.
    E429:
      description: Límite de peticiones excedido
      content:
        application/json:
          example:
            status: false
            message: Rate limit exceeded. Please try again later.
            rate_limit: 100
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API Key de la integración (Integraciones → Nueva Integración).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.