{
  "openapi": "3.1.1",
  "info": {
    "title": "All APIs",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.all-apis.net"
    }
  ],
  "paths": {
    "/v1/catalog": {
      "get": {
        "tags": ["catalog"],
        "summary": "List every business domain with its APIs.",
        "operationId": "ListApiCatalog",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IReadOnlyListOfDomainDescription"
                }
              }
            }
          }
        }
      }
    },
    "/v1/companies/fr": {
      "get": {
        "tags": ["companies"],
        "summary": "Search French companies whose name contains a fragment.",
        "description": "Up to 20 French companies whose name contains the fragment.",
        "operationId": "SearchFrenchCompaniesByName",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "boulangerie du parc"
          }
        ],
        "responses": {
          "200": {
            "description": "The matching companies, possibly empty.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IReadOnlyListOfCompany"
                },
                "example": [
                  {
                    "siren": "900000019",
                    "name": "BOULANGERIE DU PARC, SARL",
                    "legalCategoryCode": "5499",
                    "activityCode": "10.71C",
                    "createdOn": "2015-03-02",
                    "isActive": true
                  }
                ]
              }
            }
          },
          "400": {
            "description": "The name fragment has fewer than 3 or more than 200 characters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Company data is being refreshed."
          }
        }
      }
    },
    "/v1/companies/fr/{siren}": {
      "get": {
        "tags": ["companies"],
        "summary": "Find a French company by its SIREN number.",
        "description": "Legal identity of a French company: name, legal category, activity, status.",
        "operationId": "FindFrenchCompanyBySiren",
        "parameters": [
          {
            "name": "siren",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "900000027"
          }
        ],
        "responses": {
          "200": {
            "description": "The company registered under this SIREN.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Company"
                },
                "example": {
                  "siren": "900000027",
                  "name": "ATELIER NUMERIQUE",
                  "legalCategoryCode": "5710",
                  "activityCode": "62.01Z",
                  "createdOn": "2010-06-15",
                  "isActive": true
                }
              }
            }
          },
          "400": {
            "description": "The SIREN is not 9 digits with a valid Luhn check digit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No company is registered under this SIREN."
          },
          "503": {
            "description": "Company data is being refreshed."
          }
        }
      }
    },
    "/v1/geography/fr/cities": {
      "get": {
        "tags": ["geography"],
        "summary": "Find the postal codes of a French city by its name.",
        "description": "Postal codes of the French cities matching a name, accents and SAINT/ST ignored.",
        "operationId": "FindFrenchPostalCodesByCity",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Annecy"
          }
        ],
        "responses": {
          "200": {
            "description": "The matching cities with their postal codes, possibly empty.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IReadOnlyListOfCityPostalCodes"
                },
                "example": [
                  {
                    "municipalityCode": "74010",
                    "name": "ANNECY",
                    "postalCodes": ["74000", "74370", "74600", "74940"]
                  }
                ]
              }
            }
          },
          "400": {
            "description": "The city name is blank or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Postal code data is being refreshed."
          }
        }
      }
    },
    "/v1/geography/fr/postal-codes/{postalCode}/cities": {
      "get": {
        "tags": ["geography"],
        "summary": "Find the French cities served by a postal code.",
        "description": "Every city a French postal code serves, with its municipality code.",
        "operationId": "FindFrenchCitiesByPostalCode",
        "parameters": [
          {
            "name": "postalCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "74000"
          }
        ],
        "responses": {
          "200": {
            "description": "The cities served by the postal code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IReadOnlyListOfCity"
                },
                "example": [
                  {
                    "municipalityCode": "74010",
                    "name": "ANNECY",
                    "postalCode": "74000",
                    "deliveryLabel": "ANNECY",
                    "locality": null
                  }
                ]
              }
            }
          },
          "400": {
            "description": "The postal code is not 5 digits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No city uses this postal code."
          },
          "503": {
            "description": "Postal code data is being refreshed."
          }
        }
      }
    },
    "/v1/trust/email": {
      "post": {
        "tags": ["trust"],
        "summary": "Assess the trust level of an email address (syntax, domain).",
        "operationId": "AssessEmailTrust",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrustRequest__opFF3D94B441C6"
              },
              "example": {
                "value": "contact@exemple.fr"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The trust level and every check run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustReport"
                },
                "example": {
                  "subject": "email",
                  "level": "Plausible",
                  "checks": [
                    {
                      "name": "syntax",
                      "passed": true
                    },
                    {
                      "name": "domain",
                      "passed": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The value is blank or too long.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trust/fr/rib": {
      "post": {
        "tags": ["trust"],
        "summary": "Assess the trust level of a French RIB (format, key) and give its IBAN.",
        "operationId": "AssessFrenchRibTrust",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrustRequest__op89005E760D98"
              },
              "example": {
                "value": "30006 00001 12345678901 89"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The trust level and every check run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RibTrustReport"
                },
                "example": {
                  "subject": "rib",
                  "level": "Plausible",
                  "checks": [
                    {
                      "name": "format",
                      "passed": true
                    },
                    {
                      "name": "key",
                      "passed": true
                    }
                  ],
                  "iban": "FR7630006000011234567890189"
                }
              }
            }
          },
          "400": {
            "description": "The value is blank or too long.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trust/fr/siren": {
      "post": {
        "tags": ["trust"],
        "summary": "Assess the trust level of a French SIREN number.",
        "operationId": "AssessFrenchSirenTrust",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrustRequest__opDBF400267FE9"
              },
              "example": {
                "value": "900000027"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The trust level and every check run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustReport"
                },
                "example": {
                  "subject": "siren",
                  "level": "Plausible",
                  "checks": [
                    {
                      "name": "format",
                      "passed": true
                    },
                    {
                      "name": "luhnChecksum",
                      "passed": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The value is blank or too long.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trust/fr/siret": {
      "post": {
        "tags": ["trust"],
        "summary": "Assess the trust level of a French SIRET number.",
        "operationId": "AssessFrenchSiretTrust",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrustRequest__opE057574650B8"
              },
              "example": {
                "value": "35600000000047"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The trust level and every check run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustReport"
                },
                "example": {
                  "subject": "siret",
                  "level": "Plausible",
                  "checks": [
                    {
                      "name": "format",
                      "passed": true
                    },
                    {
                      "name": "checksum",
                      "passed": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The value is blank or too long.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trust/iban": {
      "post": {
        "tags": ["trust"],
        "summary": "Assess the trust level of an IBAN (format, country length, checksum).",
        "operationId": "AssessIbanTrust",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrustRequest__opD8B87262E26F"
              },
              "example": {
                "value": "FR76 3000 6000 0112 3456 7890 189"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The trust level and every check run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustReport"
                },
                "example": {
                  "subject": "iban",
                  "level": "Plausible",
                  "checks": [
                    {
                      "name": "format",
                      "passed": true
                    },
                    {
                      "name": "countryLength",
                      "passed": true
                    },
                    {
                      "name": "checksum",
                      "passed": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The value is blank or too long.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiOperation": {
        "required": ["method", "path", "summary"],
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        }
      },
      "CheckOutcome": {
        "required": ["name", "passed"],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "passed": {
            "type": "boolean"
          }
        }
      },
      "City": {
        "required": [
          "municipalityCode",
          "name",
          "postalCode",
          "deliveryLabel",
          "locality"
        ],
        "type": "object",
        "properties": {
          "municipalityCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "deliveryLabel": {
            "type": "string"
          },
          "locality": {
            "type": ["null", "string"]
          }
        }
      },
      "CityPostalCodes": {
        "required": ["municipalityCode", "name", "postalCodes"],
        "type": "object",
        "properties": {
          "municipalityCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "postalCodes": {
            "$ref": "#/components/schemas/IReadOnlyListOfString"
          }
        }
      },
      "Company": {
        "required": [
          "siren",
          "name",
          "legalCategoryCode",
          "activityCode",
          "createdOn",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "siren": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "legalCategoryCode": {
            "type": "string"
          },
          "activityCode": {
            "type": "string"
          },
          "createdOn": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NullableOfDateOnly"
              }
            ]
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "DomainDescription": {
        "required": ["name", "description", "refreshedOn", "operations"],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "refreshedOn": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NullableOfDateOnly"
              }
            ]
          },
          "operations": {
            "$ref": "#/components/schemas/IReadOnlyListOfApiOperation"
          }
        }
      },
      "IReadOnlyListOfApiOperation": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ApiOperation"
        }
      },
      "IReadOnlyListOfCheckOutcome": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/CheckOutcome"
        }
      },
      "IReadOnlyListOfCity": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/City"
        }
      },
      "IReadOnlyListOfCityPostalCodes": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/CityPostalCodes"
        }
      },
      "IReadOnlyListOfCompany": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Company"
        }
      },
      "IReadOnlyListOfDomainDescription": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/DomainDescription"
        }
      },
      "IReadOnlyListOfString": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "NullableOfDateOnly": {
        "type": "string",
        "format": "date"
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": ["null", "string"],
            "default": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1"
          },
          "title": {
            "type": ["null", "string"],
            "default": "One or more validation errors occurred."
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "default": 400
          },
          "instance": {
            "type": "string",
            "default": "/api/route"
          },
          "traceId": {
            "type": "string",
            "default": "0HMPNHL0JHL76:00000001"
          },
          "detail": {
            "type": ["null", "string"],
            "description": "the details of the error"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "the name of the error or property of the dto that caused the error",
                  "default": "Error or field name"
                },
                "reason": {
                  "type": "string",
                  "description": "the reason for the error",
                  "default": "Error reason"
                },
                "code": {
                  "type": ["null", "string"],
                  "description": "the code of the error"
                },
                "severity": {
                  "type": ["null", "string"],
                  "description": "the severity of the error"
                }
              },
              "description": "the error details object"
            }
          }
        },
        "description": "RFC9457 compatible problem details/ error response class. this can be used by configuring startup like so:\n```app.UseFastEndpoints(c =&gt; c.Errors.UseProblemDetails())```"
      },
      "RibTrustReport": {
        "required": ["subject", "level", "checks", "iban"],
        "type": "object",
        "properties": {
          "subject": {
            "type": "string"
          },
          "level": {
            "$ref": "#/components/schemas/TrustLevel"
          },
          "checks": {
            "$ref": "#/components/schemas/IReadOnlyListOfCheckOutcome"
          },
          "iban": {
            "type": ["null", "string"]
          }
        }
      },
      "TrustLevel": {
        "enum": ["Invalid", "Plausible"],
        "type": "string"
      },
      "TrustReport": {
        "required": ["subject", "level", "checks"],
        "type": "object",
        "properties": {
          "subject": {
            "type": "string"
          },
          "level": {
            "$ref": "#/components/schemas/TrustLevel"
          },
          "checks": {
            "$ref": "#/components/schemas/IReadOnlyListOfCheckOutcome"
          }
        }
      },
      "TrustRequest__op89005E760D98": {
        "const": null,
        "required": ["value"],
        "type": "object",
        "properties": {
          "value": {
            "const": null,
            "maxLength": 320,
            "minLength": 0,
            "type": "string",
            "example": "30006 00001 12345678901 89"
          }
        },
        "example": {
          "value": "30006 00001 12345678901 89"
        }
      },
      "TrustRequest__opD8B87262E26F": {
        "const": null,
        "required": ["value"],
        "type": "object",
        "properties": {
          "value": {
            "const": null,
            "maxLength": 320,
            "minLength": 0,
            "type": "string",
            "example": "FR76 3000 6000 0112 3456 7890 189"
          }
        },
        "example": {
          "value": "FR76 3000 6000 0112 3456 7890 189"
        }
      },
      "TrustRequest__opDBF400267FE9": {
        "const": null,
        "required": ["value"],
        "type": "object",
        "properties": {
          "value": {
            "const": null,
            "maxLength": 320,
            "minLength": 0,
            "type": "string",
            "example": "900000027"
          }
        },
        "example": {
          "value": "900000027"
        }
      },
      "TrustRequest__opE057574650B8": {
        "const": null,
        "required": ["value"],
        "type": "object",
        "properties": {
          "value": {
            "const": null,
            "maxLength": 320,
            "minLength": 0,
            "type": "string",
            "example": "35600000000047"
          }
        },
        "example": {
          "value": "35600000000047"
        }
      },
      "TrustRequest__opFF3D94B441C6": {
        "const": null,
        "required": ["value"],
        "type": "object",
        "properties": {
          "value": {
            "const": null,
            "maxLength": 320,
            "minLength": 0,
            "type": "string",
            "example": "contact@exemple.fr"
          }
        },
        "example": {
          "value": "contact@exemple.fr"
        }
      }
    }
  }
}
