{
  "openapi": "3.1.0",
  "info": {
    "title": "MRZ Lab API",
    "version": "1.0.0",
    "description": "Synthetic test data and MRZ checks. No authenticity or registry verification. Bearer authentication is required when the server has API_KEY configured; otherwise local requests need no key."
  },
  "servers": [
    {
      "url": "/",
      "description": "This Node server"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {}
  ],
  "paths": {
    "/api/v1/health": {
      "get": {
        "operationId": "health",
        "summary": "Server health and API version",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/profiles": {
      "get": {
        "operationId": "profiles",
        "summary": "Supported document profiles",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/profiles/{profileId}": {
      "get": {
        "operationId": "profiles__profileId_",
        "summary": "One document profile",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "fr-id",
                "es-id",
                "es-residence",
                "pt-id",
                "nl-id-old",
                "nl-id",
                "pl-id",
                "ro-id-old",
                "ro-id-2021",
                "ro-id",
                "fr-dl",
                "fr-passport",
                "es-passport",
                "it-passport",
                "gb-passport"
              ]
            }
          }
        ]
      }
    },
    "/api/v1/metadata": {
      "get": {
        "operationId": "metadata",
        "summary": "Failure modes, accepted fields, countries and limits",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/geography/france": {
      "get": {
        "operationId": "geography_france",
        "summary": "Bundled French departments, sample communes and postcodes",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dummy": {
      "post": {
        "operationId": "dummy",
        "summary": "Create seeded synthetic identity and document details. info supplies optional overrides; identifiers are always generated.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "profileId"
                ],
                "properties": {
                  "profileId": {
                    "type": "string",
                    "enum": [
                      "fr-id",
                      "es-id",
                      "es-residence",
                      "pt-id",
                      "nl-id-old",
                      "nl-id",
                      "pl-id",
                      "ro-id-old",
                      "ro-id-2021",
                      "ro-id",
                      "fr-dl",
                      "fr-passport",
                      "es-passport",
                      "it-passport",
                      "gb-passport"
                    ]
                  },
                  "seed": {
                    "type": "string",
                    "maxLength": 200,
                    "default": "mrz-lab"
                  },
                  "info": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "surname": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "givenNames": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthDate": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "expiryDate": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "sex": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "nationality": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "documentNumber": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "nationalNumber": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "optional1": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "optional2": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "usageName": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthPlace": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthCountry": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthDepartmentCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthDepartment": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "heightCm": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressLine1": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressLine2": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "postalCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "city": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressDepartmentCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressDepartment": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressCountry": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueDate": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issuePlace": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueCountry": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueDepartmentCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueDepartment": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issuingAuthority": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "cardAccessNumber": {
                        "type": "string",
                        "maxLength": 500
                      }
                    }
                  }
                }
              },
              "example": {
                "profileId": "fr-id",
                "seed": "tutorial-1"
              }
            }
          }
        }
      }
    },
    "/api/v1/generate": {
      "post": {
        "operationId": "generate",
        "summary": "Generate one MRZ. Omit info for dummy data, or supply complete generator input. seed does not randomize supplied input.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Record"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "profileId"
                ],
                "properties": {
                  "profileId": {
                    "type": "string",
                    "enum": [
                      "fr-id",
                      "es-id",
                      "es-residence",
                      "pt-id",
                      "nl-id-old",
                      "nl-id",
                      "pl-id",
                      "ro-id-old",
                      "ro-id-2021",
                      "ro-id",
                      "fr-dl",
                      "fr-passport",
                      "es-passport",
                      "it-passport",
                      "gb-passport"
                    ]
                  },
                  "seed": {
                    "type": "string",
                    "maxLength": 200,
                    "default": "mrz-lab"
                  },
                  "info": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "surname": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "givenNames": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthDate": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "expiryDate": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "sex": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "nationality": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "documentNumber": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "nationalNumber": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "optional1": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "optional2": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "usageName": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthPlace": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthCountry": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthDepartmentCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthDepartment": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "heightCm": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressLine1": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressLine2": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "postalCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "city": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressDepartmentCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressDepartment": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressCountry": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueDate": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issuePlace": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueCountry": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueDepartmentCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueDepartment": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issuingAuthority": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "cardAccessNumber": {
                        "type": "string",
                        "maxLength": 500
                      }
                    }
                  },
                  "failure": {
                    "type": "string",
                    "enum": [
                      "valid",
                      "checksum",
                      "character",
                      "length",
                      "date"
                    ],
                    "default": "valid"
                  }
                }
              },
              "example": {
                "profileId": "fr-id",
                "seed": "tutorial-1"
              }
            }
          }
        }
      }
    },
    "/api/v1/batch": {
      "post": {
        "operationId": "batch",
        "summary": "Generate 1–1000 records. Identity details stay fixed; document and national numbers vary. Supplied identifiers are regenerated.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "profileId"
                ],
                "properties": {
                  "profileId": {
                    "type": "string",
                    "enum": [
                      "fr-id",
                      "es-id",
                      "es-residence",
                      "pt-id",
                      "nl-id-old",
                      "nl-id",
                      "pl-id",
                      "ro-id-old",
                      "ro-id-2021",
                      "ro-id",
                      "fr-dl",
                      "fr-passport",
                      "es-passport",
                      "it-passport",
                      "gb-passport"
                    ]
                  },
                  "seed": {
                    "type": "string",
                    "maxLength": 200,
                    "default": "mrz-lab"
                  },
                  "info": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "surname": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "givenNames": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthDate": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "expiryDate": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "sex": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "nationality": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "documentNumber": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "nationalNumber": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "optional1": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "optional2": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "usageName": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthPlace": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthCountry": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthDepartmentCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "birthDepartment": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "heightCm": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressLine1": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressLine2": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "postalCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "city": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressDepartmentCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressDepartment": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "addressCountry": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueDate": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issuePlace": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueCountry": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueDepartmentCode": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issueDepartment": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "issuingAuthority": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "cardAccessNumber": {
                        "type": "string",
                        "maxLength": 500
                      }
                    }
                  },
                  "failure": {
                    "type": "string",
                    "enum": [
                      "valid",
                      "checksum",
                      "character",
                      "length",
                      "date"
                    ],
                    "default": "valid"
                  },
                  "count": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "default": 10
                  }
                }
              },
              "example": {
                "profileId": "fr-id",
                "seed": "tutorial-1",
                "count": 3
              }
            }
          }
        }
      }
    },
    "/api/v1/validate": {
      "post": {
        "operationId": "validate",
        "summary": "Validate an MRZ. Failed MRZ checks return HTTP 200 with status fail; partial means profile selection is needed.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "mrz"
                ],
                "properties": {
                  "mrz": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "profileId": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "fr-id",
                      "es-id",
                      "es-residence",
                      "pt-id",
                      "nl-id-old",
                      "nl-id",
                      "pl-id",
                      "ro-id-old",
                      "ro-id-2021",
                      "ro-id",
                      "fr-dl",
                      "fr-passport",
                      "es-passport",
                      "it-passport",
                      "gb-passport"
                    ],
                    "default": "auto"
                  },
                  "today": {
                    "type": "string",
                    "format": "date"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/import": {
      "post": {
        "operationId": "import",
        "summary": "Validate and import MRZ fields into generator input, including century assumptions in notes.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "mrz"
                ],
                "properties": {
                  "mrz": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "profileId": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "fr-id",
                      "es-id",
                      "es-residence",
                      "pt-id",
                      "nl-id-old",
                      "nl-id",
                      "pl-id",
                      "ro-id-old",
                      "ro-id-2021",
                      "ro-id",
                      "fr-dl",
                      "fr-passport",
                      "es-passport",
                      "it-passport",
                      "gb-passport"
                    ],
                    "default": "auto"
                  },
                  "today": {
                    "type": "string",
                    "format": "date"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/parse": {
      "post": {
        "operationId": "parse",
        "summary": "Parse layout, raw fields and character spans without validation.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "mrz"
                ],
                "properties": {
                  "mrz": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/checksum": {
      "post": {
        "operationId": "checksum",
        "summary": "Calculate an ICAO check digit with character weights.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096,
                    "pattern": "^[A-Z0-9<]+$"
                  }
                }
              },
              "example": {
                "text": "L898902C3"
              }
            }
          }
        }
      }
    },
    "/api/v1/export": {
      "post": {
        "operationId": "export",
        "summary": "Serialize generated records as a JSON, CSV or TXT attachment.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request failed; see error.code and error.message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "records",
                  "format"
                ],
                "properties": {
                  "records": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1000,
                    "items": {
                      "$ref": "#/components/schemas/Record"
                    }
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "json",
                      "csv",
                      "txt"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Info": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "surname": {
            "type": "string",
            "maxLength": 500
          },
          "givenNames": {
            "type": "string",
            "maxLength": 500
          },
          "birthDate": {
            "type": "string",
            "maxLength": 500
          },
          "expiryDate": {
            "type": "string",
            "maxLength": 500
          },
          "sex": {
            "type": "string",
            "maxLength": 500
          },
          "nationality": {
            "type": "string",
            "maxLength": 500
          },
          "documentNumber": {
            "type": "string",
            "maxLength": 500
          },
          "nationalNumber": {
            "type": "string",
            "maxLength": 500
          },
          "optional1": {
            "type": "string",
            "maxLength": 500
          },
          "optional2": {
            "type": "string",
            "maxLength": 500
          },
          "usageName": {
            "type": "string",
            "maxLength": 500
          },
          "birthPlace": {
            "type": "string",
            "maxLength": 500
          },
          "birthCountry": {
            "type": "string",
            "maxLength": 500
          },
          "birthDepartmentCode": {
            "type": "string",
            "maxLength": 500
          },
          "birthDepartment": {
            "type": "string",
            "maxLength": 500
          },
          "heightCm": {
            "type": "string",
            "maxLength": 500
          },
          "addressLine1": {
            "type": "string",
            "maxLength": 500
          },
          "addressLine2": {
            "type": "string",
            "maxLength": 500
          },
          "postalCode": {
            "type": "string",
            "maxLength": 500
          },
          "city": {
            "type": "string",
            "maxLength": 500
          },
          "addressDepartmentCode": {
            "type": "string",
            "maxLength": 500
          },
          "addressDepartment": {
            "type": "string",
            "maxLength": 500
          },
          "addressCountry": {
            "type": "string",
            "maxLength": 500
          },
          "issueDate": {
            "type": "string",
            "maxLength": 500
          },
          "issuePlace": {
            "type": "string",
            "maxLength": 500
          },
          "issueCountry": {
            "type": "string",
            "maxLength": 500
          },
          "issueDepartmentCode": {
            "type": "string",
            "maxLength": 500
          },
          "issueDepartment": {
            "type": "string",
            "maxLength": 500
          },
          "issuingAuthority": {
            "type": "string",
            "maxLength": 500
          },
          "cardAccessNumber": {
            "type": "string",
            "maxLength": 500
          }
        }
      },
      "Record": {
        "type": "object",
        "required": [
          "profile",
          "input",
          "mrz",
          "synthetic"
        ],
        "properties": {
          "profile": {
            "type": "string",
            "enum": [
              "fr-id",
              "es-id",
              "es-residence",
              "pt-id",
              "nl-id-old",
              "nl-id",
              "pl-id",
              "ro-id-old",
              "ro-id-2021",
              "ro-id",
              "fr-dl",
              "fr-passport",
              "es-passport",
              "it-passport",
              "gb-passport"
            ]
          },
          "input": {
            "$ref": "#/components/schemas/Info"
          },
          "mrz": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "synthetic": {
            "const": true
          },
          "seed": {
            "type": "string"
          },
          "failure": {
            "type": "string",
            "enum": [
              "valid",
              "checksum",
              "character",
              "length",
              "date"
            ],
            "default": "valid"
          },
          "expectedOutcome": {
            "enum": [
              "pass",
              "fail"
            ]
          },
          "actualOutcome": {
            "enum": [
              "pass",
              "fail",
              "partial"
            ]
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
