POST /absence-type

Crée un nouveau type d'absence pour l'entreprise.

Les types d'absence permettent de catégoriser les demandes d'absence des collaborateurs. Exemples de types courants :

  • Congés payés
  • RTT
  • Congé maladie
  • Télétravail
  • Formation
  • Événement client

Vous pouvez personnaliser l'apparence de chaque type avec une icône et des couleurs pour faciliter la lecture du calendrier d'équipe.

application/json

Body Required

  • name string Required

    Nom du type d'absence (obligatoire)

  • state string

    État initial (active par défaut)

    Values are active or inactive. Default value is active.

  • type string

    Catégorie du type :

    • absence : Congés, RTT, maladie (absence du collaborateur)
    • event : Formation, réunion (présent mais non disponible)

    Values are absence or event. Default value is absence.

  • icon string

    Icône Font Awesome (ex. "fa-umbrella-beach", "fa-briefcase-medical")

  • backgroundColor string

    Couleur de fond pour l'affichage calendrier

  • backgroundColorRgb string

    Couleur de fond en format RGB

  • color string

    Couleur du texte

Responses

  • 201 application/json

    Type d'absence créé avec succès

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

        Unique identifier for the absence type

      • name string

        Name of the absence type

      • state string

        State of the absence type

        Values are active or inactive. Default value is active.

      • type string

        Type of the absence type

        Values are absence or event. Default value is absence.

      • icon string

        Icon for the absence type

      • backgroundColor string

        Background color for the absence type

        Default value is #D1D1D1.

      • backgroundColorRgb string

        Background color in RGB format

      • color string

        Text color for the absence type

        Default value is #000.

  • 400

    Requête invalide - Nom manquant ou données incorrectes

  • 403

    Non autorisé - Droits insuffisants pour créer un type d'absence

POST /absence-type
curl \
 --request POST 'https://wuro.pro/api/v3.2/absence-type' \
 --header "X-APP-ID: $API_KEY" \
 --header "X-APP-SECRET: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"name":"Congés payés","state":"active","type":"absence","icon":"fa-umbrella-beach","backgroundColor":"#3498db","backgroundColorRgb":"52, 152, 219","color":"#ffffff"}'
Request examples
{
  "name": "Congés payés",
  "state": "active",
  "type": "absence",
  "icon": "fa-umbrella-beach",
  "backgroundColor": "#3498db",
  "backgroundColorRgb": "52, 152, 219",
  "color": "#ffffff"
}
Response examples (201)
{
  "newAbsenceType": {
    "_id": "string",
    "name": "string",
    "state": "active",
    "type": "absence",
    "icon": "string",
    "backgroundColor": "#D1D1D1",
    "backgroundColorRgb": "string",
    "color": "#000"
  }
}