{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arkova-ai/json-schema/arkova-ai-attestation-schema.json",
  "title": "Attestation",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arkova-ai-openapi.json#/components/schemas/Attestation",
  "type": "object",
  "required": [
    "public_id",
    "attestation_type",
    "status",
    "subject_type",
    "subject_identifier",
    "attester",
    "claims",
    "evidence",
    "evidence_count",
    "created_at",
    "verify_url"
  ],
  "properties": {
    "public_id": {
      "type": "string"
    },
    "attestation_type": {
      "type": "string",
      "enum": [
        "VERIFICATION",
        "ENDORSEMENT",
        "AUDIT",
        "APPROVAL",
        "WITNESS",
        "COMPLIANCE",
        "SUPPLY_CHAIN",
        "IDENTITY",
        "CUSTOM"
      ]
    },
    "status": {
      "type": "string"
    },
    "subject_type": {
      "type": "string",
      "enum": [
        "credential",
        "entity",
        "process",
        "asset"
      ]
    },
    "subject_identifier": {
      "type": "string"
    },
    "subject": {
      "type": "object",
      "deprecated": true,
      "description": "Deprecated v1 compatibility object mirroring subject_type and subject_identifier.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "credential",
            "entity",
            "process",
            "asset"
          ]
        },
        "identifier": {
          "type": "string"
        }
      }
    },
    "attester": {
      "type": "object",
      "required": [
        "name",
        "type"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "INSTITUTION",
            "CORPORATION",
            "INDIVIDUAL",
            "REGULATORY",
            "THIRD_PARTY"
          ]
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "type": "string",
          "enum": [
            "organization",
            "individual"
          ],
          "description": "UAT-26: organization = made on behalf of an organization by one of its administrators; individual = one person's own statement (always type INDIVIDUAL). Name, type and title are as entered by the attester."
        }
      }
    },
    "claims": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "claim"
        ],
        "properties": {
          "claim": {
            "type": "string"
          },
          "evidence": {
            "type": "string"
          }
        }
      }
    },
    "summary": {
      "type": [
        "string",
        "null"
      ]
    },
    "jurisdiction": {
      "type": "string",
      "description": "Omitted when null, never returned as null"
    },
    "fingerprint": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[a-fA-F0-9]{64}$"
    },
    "evidence_fingerprint": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[a-fA-F0-9]{64}$"
    },
    "evidence": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AttestationEvidence"
      }
    },
    "evidence_count": {
      "type": "integer",
      "minimum": 0
    },
    "chain_proof": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "tx_id": {
          "type": "string"
        },
        "block_height": {
          "type": [
            "integer",
            "null"
          ]
        },
        "timestamp": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "explorer_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        }
      }
    },
    "anchored_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Deprecated v1 alias for chain_proof.timestamp"
    },
    "merkle_root": {
      "type": [
        "string",
        "null"
      ],
      "description": "Deprecated v1 alias for the chain Merkle root when available"
    },
    "linked_credential": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "public_id": {
          "type": "string"
        },
        "credential_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "verification_status": {
          "type": "string"
        },
        "verify_url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "attestor_credentials": {
      "type": "array",
      "description": "Present only with include=credentials. Capped at the current linked credential plus two parent levels.",
      "items": {
        "$ref": "#/$defs/AttestorCredential"
      }
    },
    "issued_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "revoked_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "revocation_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "verify_url": {
      "type": "string",
      "format": "uri"
    }
  },
  "$defs": {
    "AttestationEvidence": {
      "type": "object",
      "required": [
        "id",
        "public_id",
        "evidence_type",
        "fingerprint",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^AEV-[A-F0-9]{32}$",
          "description": "v1 back-compat alias for public_id; never an internal UUID"
        },
        "public_id": {
          "type": "string",
          "pattern": "^AEV-[A-F0-9]{32}$"
        },
        "evidence_type": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "fingerprint": {
          "type": "string",
          "pattern": "^[a-fA-F0-9]{64}$"
        },
        "mime": {
          "type": [
            "string",
            "null"
          ]
        },
        "size": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "AttestorCredential": {
      "type": "object",
      "required": [
        "public_id",
        "status",
        "is_current",
        "chain_proof",
        "record_uri"
      ],
      "properties": {
        "public_id": {
          "type": "string"
        },
        "credential_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string"
        },
        "fingerprint": {
          "type": [
            "string",
            "null"
          ]
        },
        "version_number": {
          "type": [
            "integer",
            "null"
          ]
        },
        "parent_public_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "is_current": {
          "type": "boolean"
        },
        "chain_proof": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "tx_id": {
              "type": "string"
            },
            "block_height": {
              "type": [
                "integer",
                "null"
              ]
            },
            "timestamp": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "explorer_url": {
              "type": [
                "string",
                "null"
              ],
              "format": "uri"
            }
          }
        },
        "record_uri": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}