> ## 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.

# Tausch genehmigen



## OpenAPI

````yaml POST /shift_swaps/{shiftSwap}/approve
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:
  /shift_swaps/{shiftSwap}/approve:
    post:
      tags:
        - Sonstiges
      operationId: tenant.shift_swaps.approve
      parameters:
        - name: shiftSwap
          in: path
          required: true
          description: The shift swap ID
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: '`ShiftSwapRequestResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ShiftSwapRequestResource'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
components:
  schemas:
    ShiftSwapRequestResource:
      type: object
      properties:
        id:
          type: string
        requester_entry_id:
          type: string
        requester_entry:
          $ref: '#/components/schemas/RosterEntryResource'
        requester_employee:
          type:
            - string
            - 'null'
        target_employee_id:
          type: string
        target_employee:
          type:
            - string
            - 'null'
        target_entry_id:
          type: string
        target_entry:
          $ref: '#/components/schemas/RosterEntryResource'
        status:
          type: string
        manager_id:
          type: string
        auto_approved:
          type: boolean
        resolution:
          type: string
        note:
          type: string
        created_at:
          type: string
        preview_warnings:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              severity:
                type: string
              message:
                type: string
            required:
              - code
              - severity
              - message
      required:
        - id
        - requester_entry_id
        - target_employee_id
        - target_entry_id
        - status
        - manager_id
        - auto_approved
        - resolution
        - note
        - created_at
        - preview_warnings
      title: ShiftSwapRequestResource
    RosterEntryResource:
      type: object
      properties:
        id:
          type: string
        roster_id:
          type: string
        employee_id:
          type: string
        employee_name:
          type:
            - string
            - 'null'
        date:
          type: string
        shift_id:
          type: string
        shift:
          $ref: '#/components/schemas/ShiftResource'
        start_time:
          type: string
        end_time:
          type: string
        effective_start:
          type: string
        effective_end:
          type: string
        planned_work:
          type: string
        note:
          type: string
        work_area_id:
          type: string
        effective_work_area_id:
          type:
            - string
            - 'null'
        status:
          type: string
        generated:
          type: boolean
        series_id:
          type: string
        source_unit_id:
          type: string
        source_unit:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            name:
              type: string
          required:
            - id
            - name
        is_cross_unit:
          type: boolean
        published_at:
          type: string
        is_open:
          type: boolean
        applications_count:
          type: integer
        acknowledgement:
          type:
            - object
            - 'null'
          properties:
            pending:
              type: integer
              minimum: 0
            acknowledged:
              type: integer
              minimum: 0
            status:
              type: string
              enum:
                - pending
                - acknowledged
            acknowledged_at:
              type: string
          required:
            - pending
            - acknowledged
            - status
            - acknowledged_at
        my_application: {}
        warnings:
          type:
            - array
            - 'null'
          items:
            type: string
          minItems: 0
          maxItems: 0
          additionalItems: false
      required:
        - id
        - roster_id
        - employee_id
        - date
        - shift_id
        - start_time
        - end_time
        - effective_start
        - effective_end
        - planned_work
        - note
        - work_area_id
        - effective_work_area_id
        - status
        - generated
        - series_id
        - source_unit_id
        - source_unit
        - is_cross_unit
        - published_at
        - is_open
        - applications_count
        - warnings
      title: RosterEntryResource
    ShiftResource:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        abbreviation:
          type: string
        color:
          type: string
        start_time:
          type: string
        end_time:
          type: string
        break_duration:
          type: string
        is_overnight:
          type: string
        schedule_model_id:
          type: string
        work_area_id:
          type: string
        tags:
          anyOf:
            - type: string
            - type: array
              items:
                type: string
              minItems: 0
              maxItems: 0
              additionalItems: false
        note:
          type: string
        fairness_weight:
          type: integer
        net_duration_ms:
          type: integer
      required:
        - id
        - name
        - abbreviation
        - color
        - start_time
        - end_time
        - break_duration
        - is_overnight
        - schedule_model_id
        - work_area_id
        - tags
        - note
        - fairness_weight
        - net_duration_ms
      title: ShiftResource
  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
  securitySchemes:
    http:
      type: http
      description: Bearer-Token, erhalten über den Login-Endpunkt (POST /rest/login).
      scheme: bearer

````