{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/proof-holdings/json-schema/proof-holdings-validate-proof-response-schema.json",
  "title": "ValidateProofResponse",
  "description": "Proof validation result. Returns verification details when valid, or reason/message when invalid. A DELEGATION token answers with `token_type: \"delegation\"` and the `delegation` block instead of `verification`; its status resolves the cascade down to the domain control proof, which neither the status list (it packs each row's own bit) nor an offline signature check can show. Delegation-specific reasons: `unknown_delegation` (no registry record — delegations are minted fail-closed, so this is invalid, not merely unresolvable), `unsupported_version` (a delegation token of a schema major the issuer no longer accepts — 1.x after 2.0; its owner re-issues it), `test_environment` (a delegation issued in test mode), `status_unavailable`, and `identifier_unverifiable` when an `identifier` binding is requested for a delegation.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/proof-holdings-openapi.json#/components/schemas/ValidateProofResponse",
  "type": "object",
  "properties": {
    "valid": {
      "type": "boolean"
    },
    "proof_id": {
      "type": "string",
      "description": "Public proof id (ph_ctl_*), present when the proof is registered"
    },
    "verification": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The token's subject claim — a verification id for most proofs, a prefixed subject (e.g. domain_<id>) for asset proofs"
        },
        "type": {
          "$ref": "#/$defs/ProofTokenType"
        },
        "channel": {
          "$ref": "#/$defs/ProofTokenChannel"
        },
        "identifier_hash": {
          "type": "string",
          "description": "SHA-256 hash of the verified identifier — compare with your own SHA-256 hash to verify ownership"
        },
        "decision": {
          "type": "string",
          "enum": [
            "approve",
            "deny"
          ],
          "description": "The decision the proof records — present on `confirmation` and `authorization` proofs only"
        },
        "verified_at": {
          "type": "string",
          "format": "date-time"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "type",
        "channel",
        "identifier_hash",
        "verified_at",
        "expires_at"
      ]
    },
    "reason": {
      "type": "string",
      "description": "Failure reason: expired, revoked, suspended (a reversible pause — the owner can lift it), invalid (for a token signed by a current registry key this includes a token the issuer has no record of issuing), superseded (the proof was verified again and this token was replaced by a newer one for the same proof — use the newer token; offline verification does not see this), key_revoked (the token names a signing key the issuer has revoked; decided from its `kid` before the signature is checked, so it does not vouch for the token — a genuine holder fetches a re-signed one), identifier_mismatch (the supplied identifier is not what this proof is about), identifier_unverifiable (the proof's hash is derived from ciphertext, so no identifier can be bound to it), or test_environment (the proof or delegation was issued in test mode, where a test key completes verifications without a real check)"
    },
    "suspended_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the suspension began — present only with reason `suspended`"
    },
    "message": {
      "type": "string",
      "description": "Human-readable message"
    },
    "revoked_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the proof was revoked (only present when reason is \"revoked\")"
    },
    "revoked_reason": {
      "type": "string",
      "description": "Reason for revocation (only present when reason is \"revoked\")"
    },
    "token_type": {
      "type": "string",
      "enum": [
        "delegation"
      ],
      "description": "Present ONLY when the submitted token is a delegation (m-delegation-verifier-ref). Its absence means the answer is about a verification/decision proof and the `verification` block applies."
    },
    "delegation": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Public delegation handle (ph_dlg_*)"
        },
        "principal": {
          "type": "string",
          "description": "The domain whose controller authorized the artifact"
        },
        "delegate": {
          "type": "string",
          "description": "Canonical artifact identifier. Compare this byte-for-byte with the artifact identity you resolved INDEPENDENTLY — a published token is a bearer artifact, so comparing it against a field of the same card proves nothing."
        },
        "scope": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "deprecated": true,
          "description": "Deprecated. Delegation schema 2.0 carries no scope; this array stays for the SDKs released before it: the scope a delegation issued before schema 2.0 was stored with, otherwise empty. Removed in the next major version."
        },
        "control_proof": {
          "type": "string",
          "description": "Public handle of the domain control proof this delegation rests on"
        },
        "issued_at": {
          "type": "string",
          "format": "date-time"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "principal",
        "delegate",
        "scope",
        "control_proof",
        "issued_at",
        "expires_at"
      ],
      "description": "Delegation claim set, present when a valid delegation token was submitted. The attestation is domain authorization of the artifact — NOT that the artifact is safe, audited or endorsed."
    }
  },
  "required": [
    "valid"
  ],
  "$defs": {
    "ProofTokenChannel": {
      "type": "string",
      "enum": [
        "whatsapp",
        "telegram",
        "sms",
        "email",
        "dns",
        "http",
        "auto",
        "github",
        "google",
        "facebook",
        "x",
        "linkedin",
        "instagram",
        "youtube",
        "tiktok",
        "ethereum",
        "solana",
        "bitcoin",
        "coinbase",
        "kraken",
        "telegram_bot_token",
        "browser"
      ],
      "description": "The channel the proof was obtained over — a verification channel, or `browser` for a confirmation approved on the approval page"
    },
    "ProofTokenType": {
      "type": "string",
      "enum": [
        "phone",
        "email",
        "domain",
        "social",
        "wallet",
        "account",
        "telegram_bot",
        "confirmation",
        "authorization"
      ],
      "description": "What a proof token proves: control of an asset (the verification types), an approved or denied confirmation, or a granted or refused authorization"
    }
  }
}