{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pluggy/json-schema/pluggy-page-response-consents-schema.json",
  "title": "PageResponseConsents",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pluggy-consent-api-openapi.yml#/components/schemas/PageResponseConsents",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Consent"
      },
      "description": ""
    },
    "page": {
      "type": "number",
      "format": "double",
      "description": ""
    },
    "total": {
      "type": "number",
      "format": "double",
      "description": ""
    },
    "totalPages": {
      "type": "number",
      "format": "double",
      "description": ""
    }
  },
  "type": "object",
  "required": [
    "results",
    "page",
    "total",
    "totalPages"
  ],
  "$defs": {
    "Consent": {
      "description": "Item consent information",
      "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"
      ]
    }
  }
}