{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agentictradestandard.org/schemas/approval.schema.json",
  "title": "SACP approval evidence",
  "description": "A named human approver's decision, bound to one terms hash and one mandate. Carried as the payload of a signed JWS. Added in SACP 1.1.0-draft.",
  "type": "object",
  "required": [
    "sacp_approval_version",
    "approval_id",
    "mandate_id",
    "terms_hash",
    "decision",
    "approver",
    "decided_at",
    "signature"
  ],
  "additionalProperties": false,
  "properties": {
    "sacp_approval_version": {
      "const": "1.1"
    },
    "approval_id": {
      "type": "string"
    },
    "mandate_id": {
      "type": "string"
    },
    "terms_hash": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "decision": {
      "enum": [
        "approved",
        "rejected"
      ]
    },
    "approver": {
      "type": "object",
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "role": {
          "type": "string"
        }
      }
    },
    "decided_at": {
      "type": "string",
      "format": "date-time"
    },
    "authentication": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "method": {
          "type": "string",
          "description": "For example bankid, webauthn or oidc. Identity, not a payment."
        },
        "assurance": {
          "enum": [
            "low",
            "substantial",
            "high"
          ]
        }
      }
    },
    "policy_ref": {
      "type": "string",
      "format": "uri"
    },
    "signature": {
      "type": "string"
    }
  }
}
