{
  "openapi": "3.1.0",
  "info": {
    "title": "API Bengalou Pointeuse",
    "version": "1.0.0",
    "description": "API REST en lecture seule de Bengalou Pointeuse. Désactivée par défaut : la direction l'active dans Réglages → API (double authentification exigée), puis crée une clé. La clé détermine seule la structure. Dates locales de la structure (AAAA-MM-JJ), horodatages ISO 8601 avec offset, durées en minutes et en heures décimales. Les clients doivent ignorer les champs inconnus. Limites : 60 requêtes par minute et 10 000 par jour et par clé ; 500 éléments par page ; 93 jours par requête. Pointage des enfants facultatif : quand la structure ne pointe que l'équipe (`pointage_enfants` à false dans /structure), les adresses propres aux enfants (/enfants, /groupes, /pointages/enfants, /totaux/enfants, /absences) répondent 404 `enfants_desactives`, /presences/maintenant renvoie `enfants` à null et /corrections ne contient que l'équipe.",
    "contact": {
      "url": "https://pointeuse.bengalou.fr/developpeurs"
    }
  },
  "servers": [
    {
      "url": "https://pointeuse.bengalou.fr/api/v1"
    }
  ],
  "security": [
    {
      "cle": []
    }
  ],
  "paths": {
    "/moi": {
      "get": {
        "summary": "Informations sur la clé utilisée",
        "description": "Aucun scope requis.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Moi"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        }
      }
    },
    "/structure": {
      "get": {
        "summary": "La structure",
        "description": "Scope requis : `structure:lecture`.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Structure"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "structure:lecture"
      }
    },
    "/groupes": {
      "get": {
        "summary": "Les groupes",
        "description": "Scope requis : `structure:lecture`.\n\nRépond 404 `enfants_desactives` quand la structure ne pointe que l'équipe.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "donnees": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Groupe"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "structure:lecture"
      }
    },
    "/enfants": {
      "get": {
        "summary": "Les enfants",
        "description": "Sans le scope `identite:lecture`, les personnes sont pseudonymisées : seuls `id` et `reference_externe` sont renvoyés (ni prénom, ni nom, ni matricule de paie).\n\nScope requis : `personnes:lecture`.\n\nRépond 404 `enfants_desactives` quand la structure ne pointe que l'équipe.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/actif"
          },
          {
            "$ref": "#/components/parameters/groupe_id"
          },
          {
            "$ref": "#/components/parameters/modifie_depuis"
          },
          {
            "$ref": "#/components/parameters/limite"
          },
          {
            "$ref": "#/components/parameters/curseur"
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "donnees",
                    "pagination"
                  ],
                  "properties": {
                    "donnees": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Enfant"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "personnes:lecture"
      }
    },
    "/enfants/{id}": {
      "get": {
        "summary": "Un enfant",
        "description": "Scope requis : `personnes:lecture`.\n\nRépond 404 `enfants_desactives` quand la structure ne pointe que l'équipe.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Enfant"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "personnes:lecture"
      }
    },
    "/salaries": {
      "get": {
        "summary": "Les salariés",
        "description": "Scope requis : `personnes:lecture`.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/actif"
          },
          {
            "$ref": "#/components/parameters/modifie_depuis"
          },
          {
            "$ref": "#/components/parameters/limite"
          },
          {
            "$ref": "#/components/parameters/curseur"
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "donnees",
                    "pagination"
                  ],
                  "properties": {
                    "donnees": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Salarie"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "personnes:lecture"
      }
    },
    "/salaries/{id}": {
      "get": {
        "summary": "Un salarié",
        "description": "Scope requis : `personnes:lecture`.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salarie"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "personnes:lecture"
      }
    },
    "/pointages/enfants": {
      "get": {
        "summary": "Pointages des enfants",
        "description": "`du` et `au` sont obligatoires si `modifie_depuis` est absent.\n\nScope requis : `pointages:lecture`.\n\nRépond 404 `enfants_desactives` quand la structure ne pointe que l'équipe.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/du"
          },
          {
            "$ref": "#/components/parameters/au"
          },
          {
            "$ref": "#/components/parameters/enfant_id"
          },
          {
            "$ref": "#/components/parameters/groupe_id"
          },
          {
            "$ref": "#/components/parameters/modifie_depuis"
          },
          {
            "$ref": "#/components/parameters/inclure_annules"
          },
          {
            "$ref": "#/components/parameters/limite"
          },
          {
            "$ref": "#/components/parameters/curseur"
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "donnees",
                    "pagination"
                  ],
                  "properties": {
                    "donnees": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PointageEnfant"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "pointages:lecture"
      }
    },
    "/pointages/salaries": {
      "get": {
        "summary": "Pointages des salariés",
        "description": "`du` et `au` sont obligatoires si `modifie_depuis` est absent.\n\nScope requis : `pointages:lecture`.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/du"
          },
          {
            "$ref": "#/components/parameters/au"
          },
          {
            "$ref": "#/components/parameters/salarie_id"
          },
          {
            "$ref": "#/components/parameters/modifie_depuis"
          },
          {
            "$ref": "#/components/parameters/inclure_annules"
          },
          {
            "$ref": "#/components/parameters/limite"
          },
          {
            "$ref": "#/components/parameters/curseur"
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "donnees",
                    "pagination"
                  ],
                  "properties": {
                    "donnees": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PointageSalarie"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "pointages:lecture"
      }
    },
    "/presences/maintenant": {
      "get": {
        "summary": "Présences en ce moment",
        "description": "Scope requis : `presences:lecture`.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Presences"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "presences:lecture"
      }
    },
    "/totaux/enfants": {
      "get": {
        "summary": "Totaux d'heures des enfants",
        "description": "Scope requis : `totaux:lecture`.\n\nRépond 404 `enfants_desactives` quand la structure ne pointe que l'équipe.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/mois"
          },
          {
            "$ref": "#/components/parameters/du"
          },
          {
            "$ref": "#/components/parameters/au"
          },
          {
            "$ref": "#/components/parameters/enfant_id"
          },
          {
            "$ref": "#/components/parameters/groupe_id"
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "periode": {
                      "$ref": "#/components/schemas/Periode"
                    },
                    "parametres": {
                      "type": "object"
                    },
                    "donnees": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TotalEnfant"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "totaux:lecture"
      }
    },
    "/totaux/salaries": {
      "get": {
        "summary": "Totaux d'heures des salariés",
        "description": "Scope requis : `totaux:lecture`.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/mois"
          },
          {
            "$ref": "#/components/parameters/du"
          },
          {
            "$ref": "#/components/parameters/au"
          },
          {
            "$ref": "#/components/parameters/salarie_id"
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "periode": {
                      "$ref": "#/components/schemas/Periode"
                    },
                    "parametres": {
                      "type": "object"
                    },
                    "donnees": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TotalSalarie"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "totaux:lecture"
      }
    },
    "/absences": {
      "get": {
        "summary": "Absences des enfants",
        "description": "Scope requis : `absences:lecture`.\n\nRépond 404 `enfants_desactives` quand la structure ne pointe que l'équipe.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/du"
          },
          {
            "$ref": "#/components/parameters/au"
          },
          {
            "$ref": "#/components/parameters/enfant_id"
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "donnees": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Absence"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "absences:lecture"
      }
    },
    "/corrections": {
      "get": {
        "summary": "Journal des corrections",
        "description": "Scope requis : `corrections:lecture`.",
        "security": [
          {
            "cle": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/du"
          },
          {
            "$ref": "#/components/parameters/au"
          },
          {
            "name": "cible",
            "in": "query",
            "description": "Personnes concernées.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "enfant",
                "salarie"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "donnees": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Correction"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Erreur"
          },
          "401": {
            "$ref": "#/components/responses/Erreur"
          },
          "403": {
            "$ref": "#/components/responses/Erreur"
          },
          "404": {
            "$ref": "#/components/responses/Erreur"
          },
          "405": {
            "$ref": "#/components/responses/Erreur"
          },
          "422": {
            "$ref": "#/components/responses/Erreur"
          },
          "429": {
            "$ref": "#/components/responses/Erreur"
          },
          "500": {
            "$ref": "#/components/responses/Erreur"
          },
          "503": {
            "$ref": "#/components/responses/Erreur"
          }
        },
        "x-scope": "corrections:lecture"
      }
    },
    "/openapi.json": {
      "get": {
        "summary": "Cette description (OpenAPI 3.1)",
        "security": [],
        "responses": {
          "200": {
            "description": "Description de l'API",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "cle": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ptk_live_<prefixe>_<secret>",
        "description": "Clé créée dans Réglages → API. Jamais dans l'URL (refusée et marquée exposée)."
      }
    },
    "headers": {
      "RequestId": {
        "description": "Identifiant de la requête, à donner au support.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimitLimit": {
        "description": "Requêtes permises dans la fenêtre.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Requêtes restantes.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitReset": {
        "description": "Secondes avant la remise à zéro.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "parameters": {
      "id": {
        "name": "id",
        "in": "path",
        "description": "Identifiant.",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "limite": {
        "name": "limite",
        "in": "query",
        "description": "Taille de page (1 à 500, défaut 100).",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "default": 100
        }
      },
      "curseur": {
        "name": "curseur",
        "in": "query",
        "description": "Curseur opaque renvoyé par la page précédente.",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "du": {
        "name": "du",
        "in": "query",
        "description": "Premier jour (date locale, inclus).",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "au": {
        "name": "au",
        "in": "query",
        "description": "Dernier jour (date locale, inclus ; 93 jours au plus).",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "mois": {
        "name": "mois",
        "in": "query",
        "description": "Mois AAAA-MM (à la place de du/au).",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
        }
      },
      "modifie_depuis": {
        "name": "modifie_depuis",
        "in": "query",
        "description": "Synchronisation incrémentale (ISO 8601 avec offset), corrections comprises.",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "enfant_id": {
        "name": "enfant_id",
        "in": "query",
        "description": "Un ou plusieurs enfants (répétable).",
        "required": false,
        "schema": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      },
      "salarie_id": {
        "name": "salarie_id",
        "in": "query",
        "description": "Un ou plusieurs salariés (répétable).",
        "required": false,
        "schema": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      },
      "groupe_id": {
        "name": "groupe_id",
        "in": "query",
        "description": "Groupe.",
        "required": false,
        "schema": {
          "type": "integer"
        }
      },
      "actif": {
        "name": "actif",
        "in": "query",
        "description": "Personnes actives, archivées ou toutes.",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "oui",
            "non",
            "tous"
          ],
          "default": "oui"
        }
      },
      "inclure_annules": {
        "name": "inclure_annules",
        "in": "query",
        "description": "Renvoie aussi les passages remplacés par une correction.",
        "required": false,
        "schema": {
          "type": "boolean",
          "default": false
        }
      }
    },
    "responses": {
      "Erreur": {
        "description": "Erreur (RFC 9457)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Probleme"
            }
          }
        }
      }
    },
    "schemas": {
      "Probleme": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "code",
          "request_id"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "parametre_invalide",
              "cle_dans_url_interdite",
              "cle_absente",
              "cle_invalide",
              "api_desactivee",
              "scope_insuffisant",
              "ip_non_autorisee",
              "https_requis",
              "introuvable",
              "enfants_desactives",
              "methode_non_autorisee",
              "periode_trop_longue",
              "periode_requise",
              "trop_de_requetes",
              "erreur_interne",
              "maintenance"
            ]
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "limite": {
            "type": "integer"
          },
          "curseur_suivant": {
            "type": [
              "string",
              "null"
            ]
          },
          "a_plus": {
            "type": "boolean"
          }
        }
      },
      "Periode": {
        "type": "object",
        "properties": {
          "du": {
            "type": "string",
            "format": "date"
          },
          "au": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "Moi": {
        "type": "object",
        "properties": {
          "libelle": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "structure": {
            "type": "string",
            "format": "uuid"
          },
          "expire_le": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Structure": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "nom": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "fuseau": {
            "type": "string"
          },
          "statut": {
            "type": "string",
            "enum": [
              "essai",
              "active",
              "impayee",
              "expiree"
            ]
          },
          "horaires": {
            "type": "object",
            "properties": {
              "ouverture": {
                "type": "string"
              },
              "fermeture": {
                "type": "string"
              }
            }
          },
          "pointage_enfants": {
            "type": "boolean",
            "description": "Faux quand la structure ne pointe que l'équipe : les adresses propres aux enfants répondent alors 404 `enfants_desactives`."
          }
        }
      },
      "Groupe": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "nom": {
            "type": "string"
          },
          "ordre": {
            "type": "integer"
          }
        }
      },
      "Personne": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "reference_externe": {
            "type": [
              "string",
              "null"
            ]
          },
          "prenom": {
            "type": "string",
            "description": "Seulement avec identite:lecture"
          },
          "nom": {
            "type": "string",
            "description": "Seulement avec identite:lecture"
          }
        }
      },
      "Enfant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Personne"
          },
          {
            "type": "object",
            "properties": {
              "groupe_id": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "actif": {
                "type": "boolean"
              },
              "modifie_le": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        ]
      },
      "Salarie": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Personne"
          },
          {
            "type": "object",
            "properties": {
              "matricule": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Matricule de paie : seulement avec identite:lecture (il identifie indirectement le salarié)"
              },
              "actif": {
                "type": "boolean"
              },
              "modifie_le": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        ]
      },
      "PointageEnfant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "enfant": {
            "$ref": "#/components/schemas/Personne"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "arrivee": {
            "type": "string",
            "format": "date-time"
          },
          "depart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duree_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "duree_heures": {
            "type": [
              "number",
              "null"
            ]
          },
          "duree_arrondie_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "regle_arrondi": {
            "type": "object"
          },
          "source_arrivee": {
            "type": "string"
          },
          "source_depart": {
            "type": [
              "string",
              "null"
            ]
          },
          "depart_automatique": {
            "type": "boolean"
          },
          "corrige": {
            "type": "boolean"
          },
          "annule": {
            "type": "boolean"
          },
          "modifie_le": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PointageSalarie": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "salarie": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Personne"
              },
              {
                "type": "object",
                "properties": {
                  "matricule": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Matricule de paie : seulement avec identite:lecture (il identifie indirectement le salarié)"
                  }
                }
              }
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "plage": {
            "type": "integer"
          },
          "debut": {
            "type": "string",
            "format": "date-time"
          },
          "fin": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duree_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source": {
            "type": "string"
          },
          "corrige": {
            "type": "boolean"
          },
          "annule": {
            "type": "boolean"
          },
          "modifie_le": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Presences": {
        "type": "object",
        "properties": {
          "a": {
            "type": "string",
            "format": "date-time"
          },
          "enfants": {
            "oneOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "null quand la structure ne pointe que l'équipe."
          },
          "salaries": {
            "type": "object"
          }
        }
      },
      "TotalEnfant": {
        "type": "object",
        "properties": {
          "enfant": {
            "$ref": "#/components/schemas/Personne"
          },
          "jours_presents": {
            "type": "integer"
          },
          "minutes_reelles": {
            "type": "integer"
          },
          "heures_reelles": {
            "type": "number"
          },
          "minutes_arrondies": {
            "type": [
              "integer",
              "null"
            ]
          },
          "jours_absents": {
            "type": "integer"
          },
          "jours_incomplets": {
            "type": "integer"
          },
          "jours_cloture_auto": {
            "type": "integer"
          },
          "jours_corriges": {
            "type": "integer"
          }
        }
      },
      "TotalSalarie": {
        "type": "object",
        "properties": {
          "salarie": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Personne"
              },
              {
                "type": "object",
                "properties": {
                  "matricule": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Matricule de paie : seulement avec identite:lecture (il identifie indirectement le salarié)"
                  }
                }
              }
            ]
          },
          "jours_travailles": {
            "type": "integer"
          },
          "minutes_brutes": {
            "type": "integer"
          },
          "minutes_pause_deduites": {
            "type": "integer"
          },
          "minutes_payees": {
            "type": "integer"
          },
          "heures_payees": {
            "type": "number"
          },
          "minutes_payees_arrondies": {
            "type": [
              "integer",
              "null"
            ]
          },
          "jours_corriges": {
            "type": "integer"
          },
          "jours_cloture_auto": {
            "type": "integer"
          },
          "plages_ouvertes_exclues": {
            "type": "integer"
          }
        }
      },
      "Absence": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "enfant": {
            "$ref": "#/components/schemas/Personne"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "annulee": {
            "type": "boolean"
          }
        }
      },
      "Correction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "cible": {
            "type": "string",
            "enum": [
              "enfant",
              "salarie"
            ]
          },
          "personne_id": {
            "type": "integer"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "avant": {
            "type": "array"
          },
          "apres": {
            "type": "array"
          },
          "motif": {
            "type": "string"
          },
          "statut": {
            "type": "string"
          },
          "cree_le": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  }
}
