PATCH /absence/{uid}

Met à jour une absence existante.

Cas d'utilisation courants

  • Validation/Refus : Changer le state vers "accepted" ou "rejected"
  • Modification des dates : Ajuster la période d'absence
  • Annulation : Passer en state "canceled"

Système de logs

Chaque modification est tracée dans l'historique (logs). Vous pouvez ajouter un commentaire et/ou une pièce jointe à chaque action.

Les logs enregistrent automatiquement :

  • La date de l'action
  • Le poste ayant effectué l'action
  • La méthode HTTP utilisée
  • L'état résultant

Événement déclenché

Un événement UPDATE_ABSENCE est émis après la mise à jour, permettant de notifier le collaborateur des changements.

Path parameters

  • uid string Required

    Identifiant unique de l'absence

application/json

Body Required

  • from string(date-time)

    Date de début de l'absence

  • from_moment string

    Moment de début :

    • full : Journée entière
    • half-am : Matin uniquement
    • half-pm : Après-midi uniquement

    Values are half-am, half-pm, or full.

  • to string(date-time)

    Date de fin de l'absence

  • to_moment string

    Moment de fin :

    • full : Journée entière
    • half-am : Matin uniquement
    • half-pm : Après-midi uniquement

    Values are half-am, half-pm, or full.

  • state string

    Nouvel état de l'absence :

    • waiting : En attente de validation
    • accepted : Validée par le responsable
    • rejected : Refusée par le responsable
    • canceled : Annulée par le collaborateur

    Values are waiting, accepted, rejected, canceled, or inactive.

  • type string

    Référence vers le type d'absence

  • logs array[object]

    Ajouter des entrées à l'historique de l'absence

    Hide logs attributes Show logs attributes object
    • position string

      Poste ayant effectué l'action

    • date string(date-time)

      Date de l'action

    • method string

      Méthode HTTP (GET, PATCH, DELETE)

    • state string

      État après l'action

    • comment string

      Commentaire (motif de refus, remarque, etc.)

    • file string

      Pièce jointe (justificatif, certificat médical, etc.)

Responses

  • 200 application/json

    Absence mise à jour avec succès

    Hide response attribute Show response attribute object
    • updatedAbsence object
      Hide updatedAbsence attributes Show updatedAbsence attributes object
      • _id string

        Unique identifier for the absence

      • company string

        Reference to the company

      • decision_date string(date-time)

        Date when the state was changed

      • from string(date-time)

        Start date of the absence

      • from_moment string

        Moment of the day when the absence starts

        Values are half-am, half-pm, or full.

      • logs array[object]

        List of logs for the absence

        Hide logs attributes Show logs attributes object
        • position string

          Reference to the position

        • date string(date-time)

          Date of the log

        • method string

          HTTP method used

        • state string

          State of the absence at the time of the log

        • stateItemRequested string

          State of the item requested

        • comment string

          Comment added to the log

        • file string

          File attached to the log

        • fileInSafe boolean

          Whether the file is stored in the safe

          Default value is false.

        • stateLog string

          State of the log

          Values are active or inactive. Default value is active.

      • period string

        Period type of the absence

        Values are period, full, or half.

      • positionDecider string

        Reference to the position that made the decision

      • positionFrom string

        Reference to the position that created the absence

      • positionTo string

        Reference to the position for which the absence is created

      • positionLastName string

        Last name of the position for search purposes

      • positionFirstName string

        First name of the position for search purposes

      • state string

        State of the absence

        Values are waiting, accepted, rejected, canceled, or inactive. Default value is waiting.

      • nbDays number

        Number of days of absence

        Default value is 0.

      • to string(date-time)

        End date of the absence

      • to_moment string

        Moment of the day when the absence ends

        Values are half-am, half-pm, or full.

      • timezone string

        Timezone for the absence dates

      • type string

        Reference to the absence type

      • userTo string

        Reference to the user for which the absence is created

      • createdAt string(date-time)

        Date when the absence was created

      • updatedAt string(date-time)

        Date when the absence was last updated

  • 400

    Requête invalide - Données incorrectes

  • 403

    Non autorisé - Droits insuffisants pour modifier cette absence

  • 404

    Absence non trouvée

PATCH /absence/{uid}
curl \
 --request PATCH 'https://wuro.pro/api/v3.2/absence/{uid}' \
 --header "X-APP-ID: $API_KEY" \
 --header "X-APP-SECRET: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"from":"2025-05-04T09:42:00Z","from_moment":"half-am","to":"2025-05-04T09:42:00Z","to_moment":"half-am","state":"waiting","type":"string","logs":[{"position":"string","date":"2025-05-04T09:42:00Z","method":"string","state":"string","comment":"string","file":"string"}]}'
Request examples
{
  "from": "2025-05-04T09:42:00Z",
  "from_moment": "half-am",
  "to": "2025-05-04T09:42:00Z",
  "to_moment": "half-am",
  "state": "waiting",
  "type": "string",
  "logs": [
    {
      "position": "string",
      "date": "2025-05-04T09:42:00Z",
      "method": "string",
      "state": "string",
      "comment": "string",
      "file": "string"
    }
  ]
}
Response examples (200)
{
  "updatedAbsence": {
    "_id": "string",
    "company": "string",
    "decision_date": "2025-05-04T09:42:00Z",
    "from": "2025-05-04T09:42:00Z",
    "from_moment": "half-am",
    "logs": [
      {
        "position": "string",
        "date": "2025-05-04T09:42:00Z",
        "method": "string",
        "state": "string",
        "stateItemRequested": "string",
        "comment": "string",
        "file": "string",
        "fileInSafe": false,
        "stateLog": "active"
      }
    ],
    "period": "period",
    "positionDecider": "string",
    "positionFrom": "string",
    "positionTo": "string",
    "positionLastName": "string",
    "positionFirstName": "string",
    "state": "waiting",
    "nbDays": 0,
    "to": "2025-05-04T09:42:00Z",
    "to_moment": "half-am",
    "timezone": "string",
    "type": "string",
    "userTo": "string",
    "createdAt": "2025-05-04T09:42:00Z",
    "updatedAt": "2025-05-04T09:42:00Z"
  }
}