# Report sick leave status

**Requires scope:** `absence`.
Report a status update for a sick leave registration. This endpoint is used by external
integration partners to report the processing status of a sick leave registration that
was sent via webhook.
The status transitions follow a state machine:
- `in_progress`, The registration is being processed by the external system.
- `success`, The registration was successfully processed (terminal state).
- `failed`, The registration failed to process. Can be retried by sending a new status.

Note: The initial statuses `new` and `acknowledged` are set automatically by Dyflexis
when the webhook is sent and received. Only `in_progress`, `success`, and `failed`
can be reported via this endpoint.

Endpoint: POST /api/absence/v3/sick-leave/{sickLeaveRegistrationId}/status
Security: apiKey

## Path parameters:

  - `sickLeaveRegistrationId` (string, required)
    The ULID of the sick leave registration.

## Request fields (application/json):

  - `status` (string, required)
    The status to report.
    Enum: "in_progress", "success", "failed"

  - `message` (string | null)
    An optional message providing details about the status (e.g. error details on failure). Maximum 1000 characters.
    Example: Successfully imported into external system.

  - `externalReference` (string | null)
    An optional external reference identifier from the integration partner's system. Maximum 255 characters.
    Example: EXT-2026-001234

## Response 400 fields (application/json):

  - `error` (string)
    Example: The "status" field must be one of [in_progress, success, failed], "unknown" given

## Response 401 fields (application/json):

  - `title` (string, required)
    Short, human-readable summary of the error.
    Example: Unauthorized

  - `status` (integer, required)
    The HTTP status code.
    Example: 401

  - `message` (string, required)
    Human-readable explanation of this occurrence of the error.
    Example: Invalid Token

  - `detail` (string)
    Human-readable explanation of this occurrence. Not returned by all backend versions.
    Example: Invalid Token

  - `code` (integer)
    The HTTP status code (duplicate of `status`). Not returned by all backend versions.
    Example: 401

## Response 404 fields (application/json):

  - `error` (string)
    Example: Sick leave registration status not found for the given sick leave registration

## Response 422 fields (application/json):

  - `error` (string)
    Example: Cannot transition from "success" to "in_progress"

