{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://receiz.com/standards/receiz.document-seal.schema.v1.json",
  "title": "Receiz Document Seal Response Metadata v1",
  "description": "Canonical metadata contract for POST /api/document-seal responses.",
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "contentType",
        "contentDisposition",
        "sealKind",
        "basisSha256",
        "verifyPath",
        "code",
        "pulse",
        "ts",
        "anchorId",
        "anchoredPath"
      ],
      "properties": {
        "status": {
          "const": 200
        },
        "contentType": {
          "type": "string"
        },
        "contentDisposition": {
          "type": "string"
        },
        "sealKind": {
          "enum": ["png", "pdf", "trailer", "bundle"]
        },
        "basisSha256": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{64}$"
        },
        "verifyPath": {
          "type": "string"
        },
        "code": {
          "type": "string",
          "pattern": "^[A-Z0-9]{8}$"
        },
        "pulse": {
          "type": "string",
          "pattern": "^[0-9]+$"
        },
        "ts": {
          "type": "string"
        },
        "signerKeyId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{0,12}$"
        },
        "anchorId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}$"
        },
        "anchoredPath": {
          "type": "string"
        },
        "sealNote": {
          "type": "string"
        }
      }
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": ["status", "error"],
      "properties": {
        "status": {
          "type": "integer",
          "minimum": 400,
          "maximum": 599
        },
        "error": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        }
      }
    }
  ]
}
