{
  "x-generator": "NSwag v14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))",
  "openapi": "3.0.0",
  "info": {
    "title": "Consents API",
    "contact": {
      "name": "Consents API",
      "url": "https://api.enablenow.nl",
      "email": ""
    },
    "version": "v2"
  },
  "servers": [
    {
      "url": "https://api.enablenow.nl"
    }
  ],
  "paths": {
    "/v2/consents": {
      "post": {
        "tags": [
          "consents"
        ],
        "operationId": "Create consent",
        "requestBody": {
          "x-name": "requestBody",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConsentRequestBody"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfCreateConsentResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "get": {
        "tags": [
          "consents"
        ],
        "operationId": "Get paginated consents",
        "parameters": [
          {
            "name": "consentId",
            "in": "query",
            "description": "The consent identifier (Guid).",
            "schema": {
              "type": "string",
              "nullable": true
            },
            "x-position": 1
          },
          {
            "name": "userId",
            "in": "query",
            "description": "The user identifier (Guid).",
            "schema": {
              "type": "string",
              "nullable": true
            },
            "x-position": 2
          },
          {
            "name": "externalUserId",
            "in": "query",
            "description": "The external user identifier.",
            "schema": {
              "type": "string",
              "nullable": true
            },
            "x-position": 3
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "The start date to filter the results (e.g. 2025-10-01).",
            "schema": {
              "type": "string",
              "nullable": true
            },
            "x-position": 4
          },
          {
            "name": "page",
            "in": "query",
            "description": "The page number of the results to fetch (defaults to 1, e.g. 3, 10).",
            "schema": {
              "type": "string",
              "nullable": true
            },
            "x-position": 5
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "The number of results per page (defaults to 50, max. 100).",
            "schema": {
              "type": "string",
              "nullable": true
            },
            "x-position": 6
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedApiResponseOfGetConsentsResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v2/consents/{id}": {
      "delete": {
        "tags": [
          "consents"
        ],
        "operationId": "Delete consent by id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The consent identifier.",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "get": {
        "tags": [
          "consents"
        ],
        "operationId": "Get consent by id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The consent identifier.",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfGetConsentByIdResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v2/consents/{id}/refresh": {
      "post": {
        "tags": [
          "consents"
        ],
        "operationId": "Refresh consent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The consent identifier.",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfRefreshConsentByIdResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ApiResponseOfCreateConsentResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "description": "The API result object",
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/CreateConsentResponse"
              }
            ]
          }
        }
      },
      "CreateConsentResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "consentId",
          "consentUrl"
        ],
        "properties": {
          "consentId": {
            "type": "string",
            "description": "The consent id for the consent that has been created.",
            "format": "guid",
            "minLength": 1
          },
          "consentUrl": {
            "type": "string",
            "description": "The URL to which the user should be redirected to give consent.",
            "minLength": 1
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "additionalProperties": {
          "nullable": true
        },
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "CreateConsentRequestBody": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "providerKey",
          "redirectUrl"
        ],
        "properties": {
          "providerKey": {
            "type": "string",
            "description": "The bank provider key.",
            "minLength": 1
          },
          "redirectUrl": {
            "type": "string",
            "description": "The URL to redirect the user to after consent is given.",
            "minLength": 1
          },
          "syncMode": {
            "type": "string",
            "description": "SyncMode of this consent: 'full', 'provider_check' or 'none'.",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "The two letter ISO country code (defaults to 'NL')."
          },
          "userId": {
            "type": "string",
            "description": "The User Id for which to retrieve transactions.",
            "nullable": true
          },
          "externalUserId": {
            "type": "string",
            "description": "The External User Id for which to retrieve transactions.",
            "nullable": true
          }
        }
      },
      "PagedApiResponseOfGetConsentsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ApiResponseOfIEnumerableOfGetConsentsResponse"
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "_pagination"
            ],
            "properties": {
              "_pagination": {
                "description": "The pagination metadata",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/PaginationMetadata"
                  }
                ]
              }
            }
          }
        ]
      },
      "PaginationMetadata": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "page": {
            "type": "integer",
            "description": "The page number of the results.",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "description": "The number of results per page.",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "The total number of results.",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "The total number of pages.",
            "format": "int32"
          }
        }
      },
      "ApiResponseOfIEnumerableOfGetConsentsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "description": "The API result object",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/GetConsentsResponse"
            }
          }
        }
      },
      "GetConsentsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "providerKey",
          "dateStatusUpdated",
          "dateRequested"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The consent id (unique ID from EnableNow).",
            "format": "guid",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "description": "The status of the consent.",
            "minLength": 1
          },
          "providerKey": {
            "type": "string",
            "description": "The bank provider key.",
            "minLength": 1
          },
          "dateStatusUpdated": {
            "type": "string",
            "description": "DateTime (UTC) of last status update.",
            "format": "date-time"
          },
          "dateRequested": {
            "type": "string",
            "description": "DateTime (UTC) of consent initialization.",
            "format": "date-time"
          },
          "dateExpire": {
            "type": "string",
            "description": "DateTime (UTC) the consent will expire (or has expired).",
            "format": "date-time",
            "nullable": true
          },
          "dateTransactionsUpdated": {
            "type": "string",
            "description": "DateTime (UTC) of last transactions update.",
            "format": "date-time",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "description": "If the consent is in an errored state, here is detailed information about the error(s) that have occurred.",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/ErrorResult"
            }
          }
        }
      },
      "ErrorResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "date",
          "type",
          "message",
          "code"
        ],
        "properties": {
          "date": {
            "type": "string",
            "description": "DateTime (UTC) of the error.",
            "format": "date-time"
          },
          "type": {
            "type": "string",
            "description": "Type of the error."
          },
          "message": {
            "type": "string",
            "description": "The error message."
          },
          "code": {
            "type": "string",
            "description": "The error code."
          }
        }
      },
      "ApiResponseOfGetConsentByIdResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "description": "The API result object",
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/GetConsentByIdResponse"
              }
            ]
          }
        }
      },
      "GetConsentByIdResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "providerKey",
          "dateStatusUpdated",
          "dateRequested"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The consent id (unique ID from EnableNow).",
            "format": "guid",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "description": "The status of the consent.",
            "minLength": 1
          },
          "providerKey": {
            "type": "string",
            "description": "The bank provider key.",
            "minLength": 1
          },
          "dateStatusUpdated": {
            "type": "string",
            "description": "DateTime (UTC) of last status update.",
            "format": "date-time"
          },
          "dateRequested": {
            "type": "string",
            "description": "DateTime (UTC) of consent initialization.",
            "format": "date-time"
          },
          "dateExpire": {
            "type": "string",
            "description": "DateTime (UTC) the consent will expire (or has expired).",
            "format": "date-time",
            "nullable": true
          },
          "dateTransactionsUpdated": {
            "type": "string",
            "description": "DateTime (UTC) of last transactions update.",
            "format": "date-time",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "description": "If the consent is in an errored state, here is detailed information about the error(s) that have occurred.",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/ErrorResult2"
            }
          }
        }
      },
      "ErrorResult2": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "date",
          "type",
          "message",
          "code"
        ],
        "properties": {
          "date": {
            "type": "string",
            "description": "DateTime (UTC) of the error.",
            "format": "date-time"
          },
          "type": {
            "type": "string",
            "description": "Type of the error."
          },
          "message": {
            "type": "string",
            "description": "The error message."
          },
          "code": {
            "type": "string",
            "description": "The error code."
          }
        }
      },
      "ApiResponseOfRefreshConsentByIdResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "description": "The API result object",
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/RefreshConsentByIdResponse"
              }
            ]
          }
        }
      },
      "RefreshConsentByIdResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The consent id for the consent that has been refreshed.",
            "format": "guid",
            "minLength": 1
          }
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "oauth2",
        "name": "Authorization",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/connect/token",
            "scopes": {
              "customer-api": "Customer API"
            }
          }
        }
      }
    }
  }
}