{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/finchnode-com/json-schema/finchnode-com-consent-receipt-schema.json",
  "title": "ConsentReceipt",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/finchnode-com-api-openapi.yml#/components/schemas/ConsentReceipt",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "object",
    "subject",
    "action",
    "status",
    "purpose",
    "categories",
    "requestedCategories",
    "syncMode",
    "syncStatus",
    "dataAsOf",
    "grantedScopes",
    "organization",
    "source",
    "signedAt",
    "expiresAt",
    "revokedAt",
    "policyVersion"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "object": {
      "type": "string",
      "const": "consent_receipt"
    },
    "subject": {
      "type": "string"
    },
    "action": {
      "type": "string",
      "const": "share"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "revoked",
        "expired"
      ]
    },
    "purpose": {
      "type": "string"
    },
    "categories": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Category"
      }
    },
    "requestedCategories": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Category"
      }
    },
    "syncMode": {
      "type": "string",
      "enum": [
        "one-time",
        "continuous"
      ]
    },
    "syncStatus": {
      "oneOf": [
        {
          "$ref": "#/$defs/SyncStatus"
        },
        {
          "type": "null"
        }
      ]
    },
    "dataAsOf": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "grantedScopes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "organization": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "type": [
        "string",
        "null"
      ]
    },
    "signedAt": {
      "type": "string",
      "format": "date-time"
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "revokedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "policyVersion": {
      "type": "string"
    }
  },
  "$defs": {
    "Category": {
      "type": "string",
      "enum": [
        "demographics",
        "medications",
        "conditions",
        "labs",
        "vitals",
        "allergies",
        "immunizations",
        "encounters",
        "documents",
        "claims"
      ]
    },
    "SyncStatus": {
      "type": "string",
      "enum": [
        "not_started",
        "queued",
        "syncing",
        "complete",
        "partial",
        "failed",
        "reauthorization_required"
      ]
    }
  }
}