{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hogarmas.net/content-credentials/api-response-schema.json",
  "title": "H/M Content Credentials API response",
  "type": "object",
  "required": [
    "schema",
    "apiVersion",
    "state",
    "code",
    "privacy",
    "limitations"
  ],
  "properties": {
    "schema": {
      "const": "hm.content-credentials-api-response.v1"
    },
    "apiVersion": {
      "const": "2026-07-28.1"
    },
    "operation": {
      "enum": [
        "verify-envelope",
        "verify-audit"
      ]
    },
    "acceptedSchema": {
      "type": "string",
      "maxLength": 120
    },
    "receivedBytes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 4194304
    },
    "state": {
      "enum": [
        "match",
        "mismatch",
        "invalid",
        "error"
      ]
    },
    "code": {
      "type": "string",
      "maxLength": 80
    },
    "cryptographicallySigned": {
      "const": false
    },
    "issuerIdentityVerified": {
      "const": false
    },
    "reportId": {
      "type": "string",
      "maxLength": 128
    },
    "integrity": {
      "type": "object",
      "required": [
        "expectedDigest",
        "actualDigest",
        "digestMatch"
      ],
      "properties": {
        "expectedDigest": {
          "type": "string",
          "pattern": "^(|sha256:[a-f0-9]{64})$"
        },
        "actualDigest": {
          "type": "string",
          "pattern": "^(|sha256:[a-f0-9]{64})$"
        },
        "digestMatch": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "checks": {
      "type": "object",
      "properties": {
        "reportDigest": { "type": "boolean" },
        "reportId": { "type": "boolean" },
        "sourceReportDigest": { "type": "boolean" },
        "custodyLedger": { "type": "boolean" }
      },
      "additionalProperties": false
    },
    "custody": {
      "type": "object",
      "properties": {
        "valid": { "type": "boolean" },
        "eventCount": { "type": "integer", "minimum": 0, "maximum": 100 },
        "hashChained": { "type": "boolean" }
      },
      "additionalProperties": false
    },
    "runtime": {
      "type": "object"
    },
    "privacy": {
      "type": "object",
      "required": [
        "sourceMediaAccepted",
        "sourceMediaRequested",
        "submittedJsonMayContainCallerSuppliedData",
        "evidenceJsonProcessedTransiently",
        "applicationPersistence",
        "applicationMetrics",
        "rawIpStoredByApplication",
        "responseEchoesSubmittedReport"
      ],
      "properties": {
        "sourceMediaAccepted": { "const": false },
        "sourceMediaRequested": { "const": false },
        "submittedJsonMayContainCallerSuppliedData": { "const": true },
        "evidenceJsonProcessedTransiently": { "const": true },
        "applicationPersistence": { "const": false },
        "applicationMetrics": { "const": false },
        "rawIpStoredByApplication": { "const": false },
        "responseEchoesSubmittedReport": { "const": false },
        "edgeProviderOperationalLoggingOutsideApiContract": { "const": true }
      },
      "additionalProperties": false
    },
    "limitations": {
      "type": "object",
      "required": [
        "sourceMediaInspected",
        "c2paManifestParsed",
        "c2paSignatureValidated",
        "remoteTrustListUsed",
        "checksumAuthenticatesIssuer",
        "semanticTruthProven",
        "authorshipProven",
        "legalComplianceCertified"
      ],
      "properties": {
        "sourceMediaInspected": { "const": false },
        "c2paManifestParsed": { "const": false },
        "c2paSignatureValidated": { "const": false },
        "remoteTrustListUsed": { "const": false },
        "checksumAuthenticatesIssuer": { "const": false },
        "semanticTruthProven": { "const": false },
        "authorshipProven": { "const": false },
        "legalComplianceCertified": { "const": false }
      },
      "additionalProperties": false
    },
    "error": {
      "type": "object"
    }
  },
  "additionalProperties": false
}
