{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/akahu/main/json-schema/akahu-create-sharing-request-params-schema.json",
  "title": "CreateSharingRequestParams",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/akahu-apply-api-openapi.yml#/components/schemas/CreateSharingRequestParams",
  "type": "object",
  "properties": {
    "requested_days": {
      "type": "integer",
      "minimum": 30,
      "maximum": 730,
      "description": "How much historical data (i.e. bank statements) will be requested of the applicant. This is applied at the time the applicant completes the request."
    },
    "expires_in_days": {
      "type": "integer",
      "minimum": 7,
      "maximum": 60,
      "default": 30,
      "description": "The number of days from creation until this sharing request expires. Must be between 7 and 60 days.\n\nDefaults to 30 days when not provided."
    },
    "allow_manual_uploads": {
      "type": "boolean",
      "description": "Determines whether the applicant is given the option to supply data manually by uploading PDF documents."
    },
    "skip_landing_page": {
      "type": "boolean",
      "default": false,
      "description": "Skips the sharing request landing page and navigates the applicant directly to the open banking flow.\n\n`allow_manual_uploads` must be set to `false` to change the default value of this parameter."
    },
    "allow_multiple_submissions": {
      "type": "boolean",
      "description": "Determines whether the applicant is allowed to submit more data if they return to the sharing request URL after submission.\n\nDefaults to the same value as `allow_multiple_ob_connections`."
    },
    "allow_multiple_ob_connections": {
      "type": "boolean",
      "default": true,
      "description": "Determines whether the applicant is allowed to complete multiple open banking connections as part of this sharing request.\nIf set to `false`, the sharing request will submit automatically upon successful completion of an open banking connection.\n\n`allow_manual_uploads` must be set to `false` to change the default value of this parameter."
    },
    "ob_connection_filter": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SharingRequestInstitutionStub"
      },
      "minItems": 1,
      "maxItems": 1,
      "description": "Optionally restricts which institutions are available for connection via open banking.\nThis setting does not restrict the applicant's ability to upload documents from other institutions using the manual upload feature (if enabled).\n\nNote: This parameter currently accepts only a single value."
    },
    "redirect_uri": {
      "$ref": "#/$defs/SharingRequestRedirectUri"
    }
  },
  "required": [
    "requested_days",
    "allow_manual_uploads"
  ],
  "$defs": {
    "SharingRequestInstitutionStub": {
      "type": "string",
      "enum": [
        "amex",
        "anz",
        "asb",
        "bnz",
        "coop",
        "heartland",
        "kiwibank",
        "latitude",
        "sbs",
        "tsb",
        "westpac"
      ]
    },
    "SharingRequestRedirectUri": {
      "type": "string",
      "format": "uri",
      "description": "The https uri to redirect to after the sharing request is used. This can contain query parameters, e.g. for passing state.\n\nThis is optional and can be used to redirect the user to a specific page after they have successfully connected their accounts. If not provided, the user will be told that they can close the page.\n\nIf the user cancels the flow without adding any statements, they will be redirected to this uri with the query parameters `applicationId={applicationId}&sharingRequestId={sharingRequestId}&action=cancelled`.\n\nIf the user adds any statements, they will be redirected to this uri with the query parameters `applicationId={applicationId}&sharingRequestId={sharingRequestId}&action=submitted`."
    }
  }
}