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

# Update an allowance rule

> Updates an existing allowance rule. Only provide the fields you want to change. Changes are applied to all members subscribed to this rule.



## OpenAPI

````yaml https://api.absentify.com/api/v1/openapi.json patch /rules/{id}
openapi: 3.1.0
info:
  title: absentify CRUD API
  description: OpenAPI compliant REST API
  version: 1.0.0
servers:
  - url: https://api.absentify.com/api/v1
security: []
tags:
  - name: Departments
  - name: Leave types
  - name: Members
  - name: Requests
  - name: Public holidays
  - name: Workspace
  - name: Absences
  - name: Allowance Management
  - name: Out of office
externalDocs:
  url: https://absentify.com/docs/en/api-reference
paths:
  /rules/{id}:
    patch:
      tags:
        - Allowance Management
      summary: Update an allowance rule
      description: >-
        Updates an existing allowance rule. Only provide the fields you want to
        change. Changes are applied to all members subscribed to this rule.
      operationId: allowanceRule-updateRule
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                accrual_month:
                  type: integer
                  minimum: 0
                  maximum: 11
                rule_amount:
                  description: >-
                    Allowance amount per accrual cycle, must be greater than 0.
                    For hour-based allowance types the value is in MINUTES (e.g.
                    480 = 8 hours). Omit to leave a stored 0-amount (manual)
                    rule unchanged.
                  type: number
                  exclusiveMinimum: 0
                  maximum: 100000
                accrual_cycle:
                  type: string
                  enum:
                    - month
                    - year
                    - biweek
                accrual_anchor_date:
                  anyOf:
                    - type: string
                      pattern: ^\d{4}-\d{2}-\d{2}$
                    - type: 'null'
                cycle_on_employment_start:
                  type: boolean
                rule_duration:
                  description: >-
                    Per-accrual rolling expiry in months (each accrual valid
                    this many months from its accrual date). Min 1; null = off.
                    Cannot be combined with any carry-forward setting, and is
                    not allowed on a 0-amount (manual) rule.
                  anyOf:
                    - type: integer
                      minimum: 1
                      maximum: 1200
                    - type: 'null'
                upfront_allocation:
                  type: boolean
                proration_basis:
                  description: >-
                    How partial yearly rules are prorated. month = whole months
                    count fully, the partial start or end month is prorated by
                    day; day = calendar-day exact; full_month = only whole
                    months count 1/12 each, a started month counts nothing.
                    Ignored for monthly and biweekly cycles. Defaults to month.
                  type: string
                  enum:
                    - month
                    - day
                    - full_month
                max_carry_forward:
                  description: >-
                    Hard cap on the amount carried into the next fiscal year,
                    applied at the year boundary. null = unlimited (everything
                    carries), 0 = nothing carries. For hour-based allowance
                    types the value is in MINUTES.
                  anyOf:
                    - type: number
                      minimum: 0
                      maximum: 100000
                    - type: 'null'
                carry_forward_expiry_months:
                  description: >-
                    How long carried-forward allowance stays usable in the new
                    fiscal year. null = it never expires; N (>= 1) = months
                    after fiscal year end.
                  anyOf:
                    - type: integer
                      minimum: 1
                      maximum: 1200
                    - type: 'null'
                carry_forward_kept_after_expiry:
                  description: >-
                    Amount surviving permanently after the expiry deadline.
                    Requires carry_forward_expiry_months; must be lower than
                    max_carry_forward when both are set.
                  anyOf:
                    - type: number
                      minimum: 0
                      maximum: 100000
                    - type: 'null'
                reason:
                  description: >-
                    Why this rule is being changed — stored in the rule audit
                    log.
                  type: string
                  minLength: 3
                  maxLength: 500
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: number
                required:
                  - count
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - ApiKey: []
components:
  schemas:
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Invalid input data
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Invalid input data error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
    error.UNAUTHORIZED:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Authorization not provided
        code:
          type: string
          description: The error code
          example: UNAUTHORIZED
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Authorization not provided error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Authorization not provided
        issues: []
    error.FORBIDDEN:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Insufficient access
        code:
          type: string
          description: The error code
          example: FORBIDDEN
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Insufficient access error (403)
      description: The error information
      example:
        code: FORBIDDEN
        message: Insufficient access
        issues: []
    error.NOT_FOUND:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Not found
        code:
          type: string
          description: The error code
          example: NOT_FOUND
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Not found error (404)
      description: The error information
      example:
        code: NOT_FOUND
        message: Not found
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Internal server error
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Internal server error error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
  securitySchemes:
    ApiKey:
      type: apiKey
      name: X-API-KEY
      in: header

````