{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/apisign-io/json-schema/apisign-io-verification-result-schema.json",
  "title": "VerificationResult",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/apisign-io-openapi.yml#/components/schemas/VerificationResult",
  "type": "object",
  "properties": {
    "valid": {
      "type": "boolean"
    },
    "error": {
      "type": "string",
      "description": "Present when valid is false"
    },
    "contract": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/ContractStatus"
        },
        "sealedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "testMode": {
          "type": "boolean"
        },
        "signers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "signedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          }
        }
      }
    },
    "seal": {
      "nullable": true,
      "allOf": [
        {
          "type": "object",
          "properties": {
            "documentHash": {
              "type": "string"
            },
            "certificateSerial": {
              "type": "string"
            },
            "algorithm": {
              "type": "string"
            },
            "issuer": {
              "type": "string"
            }
          }
        }
      ]
    },
    "verification": {
      "type": "object",
      "properties": {
        "hasDigitalSeal": {
          "type": "boolean"
        },
        "signatureValid": {
          "type": "boolean"
        },
        "documentIntact": {
          "type": "boolean"
        },
        "certificateValid": {
          "type": "boolean"
        },
        "verifiedAt": {
          "type": "string",
          "format": "date-time"
        },
        "note": {
          "type": "string"
        }
      }
    },
    "certificate": {
      "nullable": true,
      "allOf": [
        {
          "type": "object",
          "properties": {
            "issuer": {
              "type": "string"
            },
            "validFrom": {
              "type": "string",
              "format": "date-time"
            },
            "validTo": {
              "type": "string",
              "format": "date-time"
            },
            "algorithm": {
              "type": "string"
            }
          }
        }
      ]
    }
  },
  "$defs": {
    "ContractStatus": {
      "type": "string",
      "enum": [
        "draft",
        "queued",
        "sent",
        "signed",
        "cancelled",
        "expired"
      ],
      "description": "`queued` is not set by any endpoint. `expired` is not currently set automatically: a contract past `expires_at` stays `sent`."
    }
  }
}