{
  "openapi": "3.0.3",
  "info": {
    "title": "ClearCheck Date & Timezone Utilities API",
    "version": "1.0.0",
    "description": "Différence entre deux dates, ajout de jours ouvrés (week-end et jours fériés configurables), nombre de jours ouvrés entre deux dates, conversion de fuseaux IANA avec gestion des changements d’heure.\n\nErreurs : JSON {\"error\":{\"code\",\"message\"}}. CORS ouvert. Corps limité à 8 Ko."
  },
  "servers": [
    {
      "url": "https://clearcheck-api.pages.dev"
    }
  ],
  "paths": {
    "/v1/datetime/diff": {
      "get": {
        "operationId": "datetime_diff_get",
        "summary": "Différence entre deux dates-heures",
        "tags": [
          "ClearCheck Date & Timezone Utilities API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "ISO 8601",
            "schema": {
              "type": "string"
            },
            "example": "2026-01-31T10:00:00Z"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "ISO 8601",
            "schema": {
              "type": "string"
            },
            "example": "2026-03-15T08:30:00Z"
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "Fuseau pour les dates sans offset",
            "schema": {
              "type": "string"
            },
            "example": "Africa/Nairobi"
          }
        ]
      },
      "post": {
        "operationId": "datetime_diff_post",
        "summary": "Différence entre deux dates-heures",
        "tags": [
          "ClearCheck Date & Timezone Utilities API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "from",
                  "to"
                ],
                "properties": {
                  "from": {
                    "type": "string",
                    "description": "ISO 8601"
                  },
                  "to": {
                    "type": "string",
                    "description": "ISO 8601"
                  },
                  "timezone": {
                    "type": "string",
                    "description": "Fuseau pour les dates sans offset"
                  }
                }
              },
              "example": {
                "from": "2026-01-31T10:00:00Z",
                "to": "2026-03-15T08:30:00Z",
                "timezone": "Africa/Nairobi"
              }
            }
          }
        }
      }
    },
    "/v1/datetime/add-business-days": {
      "get": {
        "operationId": "datetime_add_business_days_get",
        "summary": "Ajouter des jours ouvrés",
        "tags": [
          "ClearCheck Date & Timezone Utilities API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "AAAA-MM-JJ",
            "schema": {
              "type": "string"
            },
            "example": "2026-12-23"
          },
          {
            "name": "days",
            "in": "query",
            "required": true,
            "description": "Entier (négatif accepté)",
            "schema": {
              "type": "string"
            },
            "example": "5"
          },
          {
            "name": "weekend",
            "in": "query",
            "required": false,
            "description": "Jours de repos (défaut sat,sun)",
            "schema": {
              "type": "string"
            },
            "example": "sat,sun"
          },
          {
            "name": "holidays",
            "in": "query",
            "required": false,
            "description": "Jours fériés séparés par des virgules",
            "schema": {
              "type": "string"
            },
            "example": "2026-12-25,2026-12-26"
          }
        ]
      },
      "post": {
        "operationId": "datetime_add_business_days_post",
        "summary": "Ajouter des jours ouvrés",
        "tags": [
          "ClearCheck Date & Timezone Utilities API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "date",
                  "days"
                ],
                "properties": {
                  "date": {
                    "type": "string",
                    "description": "AAAA-MM-JJ"
                  },
                  "days": {
                    "type": "string",
                    "description": "Entier (négatif accepté)"
                  },
                  "weekend": {
                    "type": "string",
                    "description": "Jours de repos (défaut sat,sun)"
                  },
                  "holidays": {
                    "type": "string",
                    "description": "Jours fériés séparés par des virgules"
                  }
                }
              },
              "example": {
                "date": "2026-12-23",
                "days": "5",
                "weekend": "sat,sun",
                "holidays": "2026-12-25,2026-12-26"
              }
            }
          }
        }
      }
    },
    "/v1/datetime/business-days-between": {
      "get": {
        "operationId": "datetime_business_days_between_get",
        "summary": "Jours ouvrés entre deux dates",
        "tags": [
          "ClearCheck Date & Timezone Utilities API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": true,
            "description": "AAAA-MM-JJ",
            "schema": {
              "type": "string"
            },
            "example": "2026-12-01"
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "description": "AAAA-MM-JJ",
            "schema": {
              "type": "string"
            },
            "example": "2026-12-31"
          },
          {
            "name": "weekend",
            "in": "query",
            "required": false,
            "description": "Jours de repos",
            "schema": {
              "type": "string"
            },
            "example": "sat,sun"
          },
          {
            "name": "holidays",
            "in": "query",
            "required": false,
            "description": "Jours fériés",
            "schema": {
              "type": "string"
            },
            "example": "2026-12-25"
          }
        ]
      },
      "post": {
        "operationId": "datetime_business_days_between_post",
        "summary": "Jours ouvrés entre deux dates",
        "tags": [
          "ClearCheck Date & Timezone Utilities API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "start",
                  "end"
                ],
                "properties": {
                  "start": {
                    "type": "string",
                    "description": "AAAA-MM-JJ"
                  },
                  "end": {
                    "type": "string",
                    "description": "AAAA-MM-JJ"
                  },
                  "weekend": {
                    "type": "string",
                    "description": "Jours de repos"
                  },
                  "holidays": {
                    "type": "string",
                    "description": "Jours fériés"
                  }
                }
              },
              "example": {
                "start": "2026-12-01",
                "end": "2026-12-31",
                "weekend": "sat,sun",
                "holidays": "2026-12-25"
              }
            }
          }
        }
      }
    },
    "/v1/datetime/convert-timezone": {
      "get": {
        "operationId": "datetime_convert_timezone_get",
        "summary": "Convertir une date-heure entre fuseaux",
        "tags": [
          "ClearCheck Date & Timezone Utilities API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "datetime",
            "in": "query",
            "required": true,
            "description": "ISO 8601",
            "schema": {
              "type": "string"
            },
            "example": "2026-03-29T01:30:00"
          },
          {
            "name": "from_timezone",
            "in": "query",
            "required": false,
            "description": "Fuseau IANA source",
            "schema": {
              "type": "string"
            },
            "example": "Europe/Paris"
          },
          {
            "name": "to_timezone",
            "in": "query",
            "required": true,
            "description": "Fuseau IANA cible",
            "schema": {
              "type": "string"
            },
            "example": "Africa/Nairobi"
          }
        ]
      },
      "post": {
        "operationId": "datetime_convert_timezone_post",
        "summary": "Convertir une date-heure entre fuseaux",
        "tags": [
          "ClearCheck Date & Timezone Utilities API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "datetime",
                  "to_timezone"
                ],
                "properties": {
                  "datetime": {
                    "type": "string",
                    "description": "ISO 8601"
                  },
                  "from_timezone": {
                    "type": "string",
                    "description": "Fuseau IANA source"
                  },
                  "to_timezone": {
                    "type": "string",
                    "description": "Fuseau IANA cible"
                  }
                }
              },
              "example": {
                "datetime": "2026-03-29T01:30:00",
                "from_timezone": "Europe/Paris",
                "to_timezone": "Africa/Nairobi"
              }
            }
          }
        }
      }
    },
    "/v1/datetime/now": {
      "get": {
        "operationId": "datetime_now_get",
        "summary": "Heure actuelle dans un fuseau",
        "tags": [
          "ClearCheck Date & Timezone Utilities API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "Fuseau IANA",
            "schema": {
              "type": "string"
            },
            "example": "Asia/Tokyo"
          }
        ]
      }
    },
    "/v1/datetime/timezones": {
      "get": {
        "operationId": "datetime_timezones_get",
        "summary": "Liste des fuseaux IANA",
        "tags": [
          "ClearCheck Date & Timezone Utilities API"
        ],
        "responses": {
          "200": {
            "description": "Succès (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Requête invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint inconnu",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Méthode non autorisée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corps trop grand (8 Ko max)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type non JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Valeur invalide",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Filtre",
            "schema": {
              "type": "string"
            },
            "example": "Africa"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}