{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hogarmas.net/content-credentials/api-capabilities-schema.json",
  "title": "H/M Content Credentials API capabilities",
  "type": "object",
  "required": [
    "schema",
    "apiVersion",
    "status",
    "purpose",
    "runtime",
    "operations",
    "privacy",
    "limitations",
    "links"
  ],
  "properties": {
    "schema": {
      "const": "hm.content-credentials-api-capabilities.v1"
    },
    "apiVersion": {
      "const": "2026-07-28.1"
    },
    "status": {
      "const": "available"
    },
    "purpose": {
      "type": "string"
    },
    "runtime": {
      "type": "object"
    },
    "operations": {
      "type": "object",
      "required": [
        "verifyEvidenceEnvelope",
        "verifyAuditEnvelope"
      ],
      "properties": {
        "verifyEvidenceEnvelope": { "$ref": "#/$defs/operation" },
        "verifyAuditEnvelope": { "$ref": "#/$defs/operation" }
      },
      "additionalProperties": false
    },
    "privacy": {
      "type": "object"
    },
    "limitations": {
      "type": "object"
    },
    "links": {
      "type": "object"
    }
  },
  "$defs": {
    "operation": {
      "type": "object",
      "required": [
        "method",
        "url",
        "contentType",
        "acceptedSchema",
        "maximumBytes",
        "states"
      ],
      "properties": {
        "method": { "const": "POST" },
        "url": { "type": "string", "format": "uri" },
        "contentType": { "const": "application/json" },
        "acceptedSchema": { "type": "string" },
        "maximumBytes": { "type": "integer", "minimum": 1, "maximum": 4194304 },
        "states": {
          "type": "array",
          "prefixItems": [
            { "const": "match" },
            { "const": "mismatch" },
            { "const": "invalid" }
          ],
          "items": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
