{
  "openapi": "3.0.3",
  "info": {
    "title": "ClearCheck Phone Number Parser API",
    "version": "1.0.0",
    "description": "Analyse et normalise un numéro de téléphone (E.164, affichage international et national) pour 124 pays et territoires, à partir d’une table statique de plans de numérotation : indicatif, longueur, préfixe mobile quand il est fiable. Ne vérifie pas qu’une ligne est attribuée ou joignable.\n\nErreurs : JSON {\"error\":{\"code\",\"message\"}}. CORS ouvert. Corps limité à 8 Ko."
  },
  "servers": [
    {
      "url": "https://clearcheck-api.pages.dev"
    }
  ],
  "paths": {
    "/v1/phone/parse": {
      "get": {
        "operationId": "phone_parse_get",
        "summary": "Analyser un numéro",
        "tags": [
          "ClearCheck Phone Number Parser 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": "phone",
            "in": "query",
            "required": true,
            "description": "Numéro international (+254…) ou national",
            "schema": {
              "type": "string"
            },
            "example": "+254 712 345 678"
          },
          {
            "name": "default_country",
            "in": "query",
            "required": false,
            "description": "ISO 2 lettres, requis si le numéro est national",
            "schema": {
              "type": "string"
            },
            "example": "KE"
          }
        ]
      },
      "post": {
        "operationId": "phone_parse_post",
        "summary": "Analyser un numéro",
        "tags": [
          "ClearCheck Phone Number Parser 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": [
                  "phone"
                ],
                "properties": {
                  "phone": {
                    "type": "string",
                    "description": "Numéro international (+254…) ou national"
                  },
                  "default_country": {
                    "type": "string",
                    "description": "ISO 2 lettres, requis si le numéro est national"
                  }
                }
              },
              "example": {
                "phone": "+254 712 345 678",
                "default_country": "KE"
              }
            }
          }
        }
      }
    },
    "/v1/phone/normalize": {
      "get": {
        "operationId": "phone_normalize_get",
        "summary": "Normaliser en E.164 (erreur 422 si invalide)",
        "tags": [
          "ClearCheck Phone Number Parser 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": "phone",
            "in": "query",
            "required": true,
            "description": "Numéro",
            "schema": {
              "type": "string"
            },
            "example": "06 12 34 56 78"
          },
          {
            "name": "default_country",
            "in": "query",
            "required": false,
            "description": "ISO 2 lettres",
            "schema": {
              "type": "string"
            },
            "example": "FR"
          }
        ]
      },
      "post": {
        "operationId": "phone_normalize_post",
        "summary": "Normaliser en E.164 (erreur 422 si invalide)",
        "tags": [
          "ClearCheck Phone Number Parser 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": [
                  "phone"
                ],
                "properties": {
                  "phone": {
                    "type": "string",
                    "description": "Numéro"
                  },
                  "default_country": {
                    "type": "string",
                    "description": "ISO 2 lettres"
                  }
                }
              },
              "example": {
                "phone": "06 12 34 56 78",
                "default_country": "FR"
              }
            }
          }
        }
      }
    },
    "/v1/phone/countries": {
      "get": {
        "operationId": "phone_countries_get",
        "summary": "Pays couverts et règles de longueur",
        "tags": [
          "ClearCheck Phone Number Parser 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": []
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}