{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pluggy/json-schema/pluggy-consent-schema.json",
  "title": "Consent",
  "description": "Item consent information",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pluggy-consent-api-openapi.yml#/components/schemas/Consent",
  "properties": {
    "id": {
      "type": "string",
      "description": "Consent primary identifier"
    },
    "itemId": {
      "type": "string",
      "description": "Primary identifier of the item associated to the consent"
    },
    "products": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "ACCOUNTS",
          "CREDIT_CARDS",
          "TRANSACTIONS",
          "PAYMENT_DATA",
          "INVESTMENTS",
          "INVESTMENTS_TRANSACTIONS",
          "IDENTITY",
          "BROKERAGE_NOTE",
          "MOVE_SECURITY",
          "LOANS"
        ]
      },
      "description": "Products to be collected in the connection"
    },
    "openFinancePermissionsGranted": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "REGISTRATION_ALL",
          "REGISTRATION_IDENTIFICATIONS",
          "REGISTRATION_QUALIFICATIONS",
          "REGISTRATION_FINANCIAL_RELATIONS",
          "ACCOUNTS_ALL",
          "ACCOUNTS_LIST",
          "ACCOUNTS_BALANCES",
          "ACCOUNTS_LIMITS",
          "ACCOUNTS_TRANSACTIONS",
          "CREDIT_CARDS_ALL",
          "CREDIT_CARDS_LIST",
          "CREDIT_CARDS_LIMITS",
          "CREDIT_CARDS_TRANSACTIONS",
          "CREDIT_CARDS_BILLS",
          "CREDIT_OPERATIONS_ALL",
          "INVESTMENTS_ALL",
          "EXCHANGES_ALL"
        ]
      },
      "description": "Products consented by the user to be collected"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Date when the consent was given"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time",
      "description": "Date when the consent expires. Null if the consent doesn't expire"
    },
    "revokedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Date when the consent was revoked"
    }
  },
  "type": "object",
  "required": [
    "id",
    "itemId",
    "products",
    "createdAt"
  ]
}