GET /absences

Récupère la liste des absences de l'entreprise avec de nombreuses options de filtrage.

Cette route est particulièrement utile pour :

  • Afficher le calendrier des absences d'équipe
  • Filtrer les absences par collaborateur ou période
  • Obtenir les absences du jour (pour un dashboard RH)

Filtres de période

Plusieurs modes de filtrage temporel sont disponibles :

  • month + year : Absences sur un mois calendaire (avec marge du mois précédent/suivant)
  • today : Absences en cours aujourd'hui (distingue matin/après-midi)
  • from / to : Filtrer par date de début ou fin exacte
  • inPeriod : Absences chevauchant une période donnée

Gestion des demi-journées

Les absences peuvent commencer ou finir en demi-journée :

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

Query parameters

  • limit integer

    Nombre maximum d'absences à retourner

    Default value is 20.

  • skip integer

    Nombre d'absences à ignorer (pagination)

    Default value is 0.

  • sort string

    Tri des résultats (ex. "from:-1" pour les plus récentes d'abord)

  • state string

    Filtrer par état de l'absence :

    • waiting : En attente de validation
    • accepted : Validée
    • rejected : Refusée
    • canceled : Annulée par le collaborateur
    • inactive : Supprimée (soft delete)

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

  • positionTo string | array[string]

    Filtrer par poste concerné. Valeurs spéciales :

    • all : Tous les postes
    • onlyActive : Postes actifs uniquement
    • ID de poste pour un poste spécifique
    • Tableau d'IDs pour plusieurs postes
  • userTo string

    Filtrer par utilisateur concerné

  • type string | array[string]

    Filtrer par type d'absence (peut être un tableau)

  • month integer

    Mois pour le filtre calendrier (1-12). Requiert year.

    Minimum value is 1, maximum value is 12.

  • year integer

    Année pour le filtre calendrier. Requiert month.

  • today boolean

    Si true, retourne uniquement les absences du jour en cours

  • from string(date-time)

    Filtrer par date de début (format ISO)

  • to string(date-time)

    Filtrer par date de fin (format ISO)

  • inPeriod array[string(date-time)]

    Tableau de 2 dates [début, fin] pour obtenir les absences chevauchant cette période. Utile pour le calendrier : récupère les absences qui commencent, finissent ou traversent la période.

    At least 2 but not more than 2 elements.

Responses

  • 200 application/json

    Liste des absences avec pagination

    Hide response attributes Show response attributes object
    • absences array[object]

      Tableau des absences correspondant aux filtres

      Hide absences attributes Show absences 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

    • total integer

      Nombre total d'absences (avant pagination)

    • limit integer

      Limite utilisée

    • skip integer

      Offset utilisé

  • 403

    Non autorisé - Accès aux absences refusé

GET /absences
curl \
 --request GET 'https://wuro.pro/api/v3.2/absences' \
 --header "X-APP-ID: $API_KEY" \
 --header "X-APP-SECRET: $API_KEY"
Response examples (200)
{
  "absences": [
    {
      "_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"
    }
  ],
  "total": 42,
  "limit": 42,
  "skip": 42
}