{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/isgenai/json-schema/isgenai-c2pa-inspection-response-schema.json",
  "title": "C2paInspectionResponse",
  "description": "isgenai.c2pa-inspection.v1. Optional fields are omitted when the manifest does not carry them.",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/isgenai-openapi.json#/components/schemas/C2paInspectionResponse",
  "type": "object",
  "required": [
    "schema",
    "generated_at",
    "status",
    "file",
    "c2pa",
    "validation",
    "limitations"
  ],
  "properties": {
    "schema": {
      "type": "string",
      "enum": [
        "isgenai.c2pa-inspection.v1"
      ]
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "$ref": "#/$defs/C2paInspectionStatus"
    },
    "file": {
      "type": "object",
      "required": [
        "name",
        "type",
        "size",
        "sha256"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "size": {
          "type": "integer",
          "minimum": 0
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        }
      }
    },
    "c2pa": {
      "type": "object",
      "required": [
        "detected",
        "embedded",
        "manifest_labels"
      ],
      "properties": {
        "detected": {
          "type": "boolean"
        },
        "embedded": {
          "type": "boolean"
        },
        "remote_url": {
          "type": "string"
        },
        "manifest_labels": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "active_manifest": {
          "$ref": "#/$defs/C2paActiveManifest"
        }
      }
    },
    "validation": {
      "type": "object",
      "required": [
        "cryptographic_validation",
        "trust_validation",
        "success_codes",
        "informational_codes",
        "failure_codes",
        "status_codes"
      ],
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "Invalid",
            "Valid",
            "Trusted"
          ]
        },
        "cryptographic_validation": {
          "type": "string",
          "enum": [
            "VALIDATED",
            "FAILED",
            "NOT_PRESENT",
            "NOT_EVALUATED"
          ]
        },
        "trust_validation": {
          "type": "string",
          "enum": [
            "TRUSTED",
            "UNTRUSTED_OR_UNKNOWN",
            "NOT_PRESENT",
            "NOT_EVALUATED"
          ]
        },
        "success_codes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "informational_codes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "failure_codes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "status_codes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/C2paStatusCode"
          }
        }
      }
    },
    "limitations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "C2paActiveManifest": {
      "type": "object",
      "required": [
        "claim_generator_info",
        "ingredients_count",
        "assertions_count",
        "action_count",
        "actions"
      ],
      "properties": {
        "label": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "format": {
          "type": "string"
        },
        "claim_generator": {
          "type": "string"
        },
        "claim_generator_info": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "ingredients_count": {
          "type": "integer",
          "minimum": 0
        },
        "assertions_count": {
          "type": "integer",
          "minimum": 0
        },
        "action_count": {
          "type": "integer",
          "minimum": 0
        },
        "actions": {
          "type": "array",
          "maxItems": 8,
          "items": {
            "type": "string"
          },
          "description": "Up to eight recorded actions, with the IPTC digital source type in parentheses when present."
        },
        "digital_source_types": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "IPTC digital source type codes recorded in c2pa.actions, e.g. trainedAlgorithmicMedia."
        },
        "signature": {
          "type": "object",
          "properties": {
            "alg": {
              "type": "string"
            },
            "issuer": {
              "type": "string"
            },
            "common_name": {
              "type": "string"
            },
            "time": {
              "type": "string"
            },
            "revocation_status": {
              "type": "boolean"
            }
          }
        }
      }
    },
    "C2paInspectionStatus": {
      "type": "string",
      "enum": [
        "C2PA_TRUSTED",
        "C2PA_VALIDATED",
        "C2PA_VALIDATED_WITH_WARNINGS",
        "C2PA_INVALID",
        "NO_C2PA_MANIFEST",
        "UNSUPPORTED_FILE",
        "C2PA_VALIDATION_ERROR"
      ],
      "description": "Overall inspection outcome. C2PA_VALIDATED_WITH_WARNINGS includes a valid signature from a signer that is not on the trust list. NO_C2PA_MANIFEST means no manifest was found in this copy, not that the content is human-made."
    },
    "C2paStatusCode": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "success": {
          "type": "boolean"
        },
        "explanation": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    }
  }
}