{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/blindpay-com/json-schema/blindpay-com-instance-rfi-schema.json",
  "title": "InstanceRfi",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blindpay-com-instances-api-openapi.yml#/components/schemas/InstanceRfi",
  "type": [
    "object",
    "null"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "instance_id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "submitted",
        "expired",
        "cancelled"
      ]
    },
    "request": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RfiSection"
      },
      "minItems": 1,
      "maxItems": 20
    },
    "response": {
      "type": "object",
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 4096
          },
          {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "maxItems": 20
          }
        ]
      }
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "submitted_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "instance_id",
    "status",
    "request",
    "response",
    "expires_at",
    "submitted_at",
    "created_at"
  ],
  "$defs": {
    "RfiField": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "label": {
          "type": "string",
          "maxLength": 256
        },
        "regex": {
          "type": "string",
          "maxLength": 512
        },
        "required": {
          "type": "boolean"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "label",
              "value"
            ]
          }
        },
        "multiple": {
          "type": "boolean"
        },
        "aiprise_document_type": {
          "type": "string",
          "enum": [
            "ADDRESS_PROOF_DOCUMENT",
            "SOURCE_OF_FUNDS_DOCUMENT",
            "BANK_STATEMENT_DOCUMENT",
            "USER_SELFIE",
            "TAX_CERTIFICATE",
            "VISA_DOCUMENT",
            "OTHER"
          ]
        }
      },
      "required": [
        "key",
        "label",
        "required"
      ]
    },
    "RfiSection": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "description": {
          "type": "string",
          "maxLength": 4096
        },
        "supporting_document": {
          "type": "string",
          "format": "uri"
        },
        "fields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RfiField"
          },
          "minItems": 1,
          "maxItems": 20
        }
      },
      "required": [
        "title",
        "description",
        "fields"
      ]
    }
  }
}