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

# Urlaubsanspruch aktualisieren

> Create or update a vacation entitlement for a year. Value changes are
routed through the ledger allocator as `grant` (creation) or
`adjustment` (existing) transactions so the ledger stays authoritative.



## OpenAPI

````yaml PUT /employees/{employee}/vacation_entitlements
openapi: 3.1.0
info:
  title: Stampfactory API
  version: 1.0.0
  description: >-
    REST API für die Stampfactory Zeiterfassungs- und
    Personalverwaltungsplattform.


    ## Basis-URL


    Jeder Mandant hat eine eigene Subdomain: `https://{tenant}.stamp.eu/rest/…`.

    Custom Domains werden unterstützt; der Pfad-Präfix ist immer `/rest`.

    Authentifizierung über `POST /rest/login` (Bearer-Token, Laravel Sanctum).


    ## Datenformate (verbindlich, ADR 0005)


    | Typ | Format | Beispiel |

    |---|---|---|

    | Dauer (Anzeige) | String `HH:MM:SS.mmm`, Feldname ohne Suffix |
    `"08:00:00.000"` |

    | Dauer (Rohwert) | Integer Millisekunden, Feldname mit Suffix `_ms` |
    `28800000` |

    | Datum | ISO 8601 (`YYYY-MM-DD`) | `"2026-07-25"` |

    | Fachliche Zeitstempel (Stempelungen, Korrekturen) | ISO 8601 in
    Mandanten-Zeitzone | `"2026-07-25T08:00:00+02:00"` |

    | Technische Metadaten (`created_at`, `updated_at`) | ISO 8601 UTC |
    `"2026-07-25T06:00:00+00:00"` |

    | IDs | UUID bzw. TypeID-String | `"9d3f…"` |

    | Arbeitszeit-Flags | Integer-Bitmaske (`flags`), Bits siehe
    `WorkingTimeFlag` | `512` = Feiertag |

    | Monats-Perioden | `YYYY-MM` | `"2026-07"` |


    ## Responses


    Erfolgs-Responses liefern die fachliche Payload unter `data`

    (dokumentierte Ausnahmen: `POST /rest/terminal/{code}` und `/rest/mobile`).

    Listen sind, wo paginiert, im Laravel-Paginator-Format (`data` + `links` +
    `meta`).


    ## Fehlerformat


    Alle Fehler (4xx/5xx) folgen einem einheitlichen Envelope:


    ```json

    {
      "request_id": "…",
      "timestamp": "2026-07-25T06:00:00Z",
      "message": "Menschlich lesbare Meldung",
      "field_errors": { "feld": ["Meldung"] },
      "errors": [{ "title": "…", "detail": "…", "type": "https://docs.stampfactory.eu/errors#…", "_meta": { } }]
    }

    ```


    `field_errors` erscheint bei Validierungsfehlern (422). Endpoint-spezifische

    Zusatzdaten (z. B. `warnings`, `earliest`, `code`) stehen kanonisch in

    `errors[0]._meta`; Top-Level-Duplikate sind eine
    Übergangs-Kompatibilitätsschicht.

    Die `type`-URLs verlinken auf die Fehlerdokumentation.
servers:
  - url: https://{tenant}.stamp.eu/rest
    description: Production
    variables:
      tenant:
        default: demo
        description: Subdomain des Mandanten
security:
  - http: []
paths:
  /employees/{employee}/vacation_entitlements:
    put:
      tags:
        - Urlaubsanspruch
      summary: PUT /rest/employees/{employee}/vacation_entitlements
      description: |-
        Create or update a vacation entitlement for a year. Value changes are
        routed through the ledger allocator as `grant` (creation) or
        `adjustment` (existing) transactions so the ledger stays authoritative.
      operationId: tenant.employees.vacation_entitlements.update
      parameters:
        - name: employee
          in: path
          required: true
          description: The employee ID
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateVacationEntitlementRequest'
      responses:
        '200':
          description: '`VacationEntitlementResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/VacationEntitlementResource'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    UpdateVacationEntitlementRequest:
      type: object
      properties:
        year:
          type: integer
          minimum: 2020
          maximum: 2100
        total_days:
          type: number
          minimum: 0
        carried_over:
          type: number
          minimum: 0
        statutory_days:
          type: number
          minimum: 0
        extra_days:
          type: number
          minimum: 0
        carryover_expires_at:
          type:
            - string
            - 'null'
          format: date-time
        extra_expires_at:
          type:
            - string
            - 'null'
          format: date-time
        note:
          type:
            - string
            - 'null'
          maxLength: 1000
      required:
        - year
        - total_days
      title: UpdateVacationEntitlementRequest
    VacationEntitlementResource:
      type: object
      properties:
        id:
          type: string
        employee_id:
          type: string
        year:
          type: string
        total_days:
          type: number
        used_days:
          type: number
        remaining_days:
          type: number
        carried_over:
          type: number
        buckets:
          type: array
          items:
            type: object
            properties:
              bucket:
                type: string
              granted:
                type: number
              used:
                type: number
              remaining:
                type: number
              expires_at:
                type: string
            required:
              - bucket
              - granted
              - used
              - remaining
              - expires_at
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - employee_id
        - year
        - total_days
        - used_days
        - remaining_days
        - carried_over
        - buckets
        - created_at
        - updated_at
      title: VacationEntitlementResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    http:
      type: http
      description: Bearer-Token, erhalten über den Login-Endpunkt (POST /rest/login).
      scheme: bearer

````