{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ibm-db2/json-schema/ibm-db2-data-load-job-request-schema.json",
  "title": "DataLoadJobRequest",
  "description": "Data load request",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ibm-db2-openapi.yml#/components/schemas/DataLoadJobRequest",
  "type": "object",
  "required": [
    "load_source",
    "schema",
    "table",
    "file_options"
  ],
  "properties": {
    "load_source": {
      "type": "string",
      "description": "Type of data source. It can take the values 'SERVER', 'S3', or 'IBMCloud'.",
      "enum": [
        "SERVER",
        "S3",
        "IBMCloud"
      ]
    },
    "load_action": {
      "type": "string",
      "description": "If set to 'INSERT' data is appended to the existing table data. If set to 'REPLACE' the table data is replaced with the data being loaded.",
      "enum": [
        "INSERT",
        "REPLACE"
      ],
      "default": "INSERT"
    },
    "schema": {
      "type": "string",
      "description": "Schema name where the target table is located"
    },
    "table": {
      "type": "string",
      "description": "Table name where data should be loaded"
    },
    "max_row_count": {
      "type": "integer",
      "format": "int64",
      "description": "Maximum number of rows to be loaded. If set to zero or not specified, all rows from the source data are loaded. Not supported in multi-partitioned (MPP) IBM Db2 Warehouse SaaS environments.",
      "default": 0
    },
    "max_warning_count": {
      "type": "integer",
      "format": "int64",
      "description": "Maximum number of warnings that are tolerated before failing the load operation. A warning is generated for each row that is not loaded correctly.",
      "default": 1000
    },
    "cloud_source": {
      "type": "object",
      "description": "Required when load_type is set to \"S3\" or \"SOFTLAYER\". It specifies how to located the data to be loaded from a cloud storage service.",
      "required": [
        "endpoint",
        "path",
        "auth_id",
        "auth_secret"
      ],
      "properties": {
        "endpoint": {
          "type": "string",
          "description": "URL of the cloud storage endpoint where data is located.\nAmazon S3 valid endpoints are \"s3.amazonaws.com\", \"s3.us-east-2.amazonaws.com\", \"s3-us-west-1.amazonaws.com, \"s3-us-west-2.amazonaws.com\", \"s3.ca-central-1.amazonaws.com\",  \"s3.ap-south-1.amazonaws.com\", \"s3.ap-northeast-2.amazonaws.com\", \"s3-ap-southeast-1.amazonaws.com\", \"s3-ap-southeast-2.amazonaws.com\", \"s3-ap-northeast-1.amazonaws.com\", \"s3.eu-central-1.amazonaws.com\", \"s3-eu-west-1.amazonaws.com\", \"s3.eu-west-2.amazonaws.com\", \"s3-sa-east-1.amazonaws.com\".\nSoftLayer object storage valid endpoints are \"https://ams01.objectstorage.softlayer.net/auth/v1.0\", \"https://che01.objectstorage.softlayer.net/auth/v1.0\", \"https://dal05.objectstorage.softlayer.net/auth/v1.0\", \"https://fra02.objectstorage.softlayer.net/auth/v1.0\", \"https://hkg02.objectstorage.softlayer.net/auth/v1.0\", \"https://lon02.objectstorage.softlayer.net/auth/v1.0\", \"https://mel01.objectstorage.softlayer.net/auth/v1.0\", \"https://mex01.objectstorage.softlayer.net/auth/v1.0\", \"https://mil01.objectstorage.softlayer.net/auth/v1.0\", \"https://mon01.objectstorage.softlayer.net/auth/v1.0\", \"https://par01.objectstorage.softlayer.net/auth/v1.0\", \"https://sao01.objectstorage.softlayer.net/auth/v1.0\", \"https://seo01.objectstorage.softlayer.net/auth/v1.0\", \"https://sjc01.objectstorage.softlayer.net/auth/v1.0\", \"https://sng01.objectstorage.softlayer.net/auth/v1.0\", \"https://syd01.objectstorage.softlayer.net/auth/v1.0\", \"https://tok02.objectstorage.softlayer.net/auth/v1.0\", \"https://tor01.objectstorage.softlayer.net/auth/v1.0\", \"https://wdc.objectstorage.softlayer.net/auth/v1.0\".\n"
        },
        "path": {
          "type": "string",
          "description": "Path used to find and retrieve the data in the cloud storage service"
        },
        "auth_id": {
          "type": "string",
          "description": "Username (SoftLayer) or Access Key (S3)."
        },
        "auth_secret": {
          "type": "string",
          "description": "API Key (SoftLayer) or Secret Key (S3)."
        }
      }
    },
    "server_source": {
      "type": "object",
      "description": "Required when load_type is set to \"SERVER\". It specifies how to source filein the server.",
      "required": [
        "file_path"
      ],
      "properties": {
        "file_path": {
          "type": "string",
          "description": "File path in the server relative to the user's home folder."
        }
      }
    },
    "file_options": {
      "type": "object",
      "description": "Modifies how the source data should be interpreted",
      "properties": {
        "code_page": {
          "type": "string",
          "description": "The character encoding of the source file. Valid values are listed in <a target=\"_blank\" href=\"https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.admin.nls.doc/doc/r0004565.html\">Supported territory codes and code pages</a>. Default value is \"1208\" (corresponds to UTF-8)."
        },
        "has_header_row": {
          "type": "string",
          "description": "Specifies whether or not the source file includes column names in a header row. IBM Db2 SaaS does not support this function, so the only acceptable value is NO.",
          "enum": [
            "no"
          ],
          "default": "no"
        },
        "column_delimiter": {
          "type": "string",
          "description": "Single character used as column delimiter. Default value is comma (\",\"). The character can also be specified using the format 0xJJ, where JJ is the hexadecimal representation of the character. Valid delimiters can be hexadecimal values from 0x00 to 0x7F, except for binary zero (0x00), line-feed (0x0A), carriage return (0x0D), space (0x20), and decimal point (0x2E).",
          "default": ","
        },
        "date_format": {
          "type": "string",
          "description": "A valid date format, such as \"DD-MM-YY\", \"YYYY-MMM-DD\", \"DD/MM/YYY\", \"M/D/YYYY\", \"M/DD\", \"YYYY\". For a full list of supported formats, see <a target=\"_blank\" href=\"https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0008305.html\">Valid file type modifiers for the load utility - ASCII file formats (ASC/DEL)</a>, in the LOAD command reference.",
          "default": "YYYY-MM-DD"
        },
        "time_format": {
          "type": "string",
          "description": "A valid time format, such as \"HH-MM-SS\", \"H:MM:SS TT\", \"HH:MM\", \"H:MM TT\", \"H:M\", \"H:M:S\". For a full list of supported formats, see <a target=\"_blank\" href=\"https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0008305.html\">Valid file type modifiers for the load utility - ASCII file formats (ASC/DEL)</a>, in the LOAD command reference.",
          "default": "HH:MM:SS"
        },
        "timestamp_format": {
          "type": "string",
          "description": "A valid timestamp format, such as \"YYYY-MM-DD HH:MM:SS\", \"DD/MM/YYYY H:MM TT\", \"MMM DD YYYY HH:MM:SS TT\". For a full list of supported formats, see <a target=\"_blank\" href=\"https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0008305.html\">Valid file type modifiers for the load utility - ASCII file formats (ASC/DEL)</a>, in the LOAD command reference.",
          "default": "YYYY-MM-DD HH:MM:SS"
        }
      }
    }
  }
}