{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-connect/json-schema/amazon-connect-create-data-table-attribute-request-schema.json",
  "title": "CreateDataTableAttributeRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-connect-attributes-api-openapi.yml#/components/schemas/CreateDataTableAttributeRequest",
  "type": "object",
  "properties": {
    "InstanceId": {
      "type": "string",
      "description": "The unique identifier for the Amazon Connect instance."
    },
    "DataTableId": {
      "type": "string",
      "description": "The unique identifier for the data table. Must also accept the table ARN with or without a version alias. If the version is provided as part of the identifier or ARN, the version must be one of the two available system managed aliases, $SAVED or $LATEST."
    },
    "Name": {
      "type": "string",
      "description": "The name for the attribute. Must conform to Connect human readable string specification and have 1-127 characters. Must not start with the reserved case insensitive values 'connect:' and 'aws:'. Whitespace trimmed before persisting. Must be unique for the data table using case-insensitive comparison."
    },
    "ValueType": {
      "type": "string",
      "enum": [
        "TEXT",
        "NUMBER",
        "BOOLEAN",
        "TEXT_LIST",
        "NUMBER_LIST"
      ],
      "description": "The type of value allowed or the resultant type after the value's expression is evaluated. Must be one of TEXT, TEXT_LIST, NUMBER, NUMBER_LIST, and BOOLEAN."
    },
    "Description": {
      "type": "string",
      "description": "An optional description for the attribute. Must conform to Connect human readable string specification and have 0-250 characters. Whitespace trimmed before persisting."
    },
    "Primary": {
      "type": "boolean",
      "description": "Optional boolean that defaults to false. Determines if the value is used to identify a record in the table. Values for primary attributes must not be expressions."
    },
    "Validation": {
      "$ref": "#/$defs/Validation"
    }
  },
  "required": [
    "InstanceId",
    "DataTableId",
    "Name",
    "ValueType"
  ],
  "$defs": {
    "Validation": {
      "type": "object",
      "properties": {
        "MinLength": {
          "type": "integer",
          "description": "The minimum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be less than or equal to MaxLength."
        },
        "MaxLength": {
          "type": "integer",
          "description": "The maximum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be greater than or equal to MinLength."
        },
        "MinValues": {
          "type": "integer",
          "description": "The minimum number of values in a list. Must be an integer greater than or equal to 0 and less than or equal to MaxValues. Applies to all list types."
        },
        "MaxValues": {
          "type": "integer",
          "description": "The maximum number of values in a list. Must be an integer greater than or equal to 0 and greater than or equal to MinValues. Applies to all list types."
        },
        "IgnoreCase": {
          "type": "boolean",
          "description": "Boolean that defaults to false. Applies to text lists and text primary attributes. When true, enforces case-insensitive uniqueness for primary attributes and allows case-insensitive lookups."
        },
        "Minimum": {
          "type": "number",
          "description": "The smallest inclusive numeric value for NUMBER value type. Cannot be provided when ExclusiveMinimum is also provided. Must be less than or equal to Maximum and less than ExclusiveMaximum. Applies to NUMBER and values within NUMBER_LIST."
        },
        "Maximum": {
          "type": "number",
          "description": "The largest inclusive numeric value for NUMBER value type. Can be provided alongside ExclusiveMaximum where both operate independently. Must be greater than or equal to Minimum and greater than ExclusiveMinimum. Applies to NUMBER and values within NUMBER_LIST."
        },
        "ExclusiveMinimum": {
          "type": "number",
          "description": "The smallest exclusive numeric value for NUMBER value type. Can be provided alongside Minimum where both operate independently. Must be less than ExclusiveMaximum and Maximum. Applies to NUMBER and values within NUMBER_LIST."
        },
        "ExclusiveMaximum": {
          "type": "number",
          "description": "The largest exclusive numeric value for NUMBER value type. Can be provided alongside Maximum where both operate independently. Must be greater than ExclusiveMinimum and Minimum. Applies to NUMBER and values within NUMBER_LIST."
        },
        "MultipleOf": {
          "type": "number",
          "description": "Specifies that numeric values must be multiples of this number. Must be greater than 0. The result of dividing a value by this multiple must result in an integer. Applies to NUMBER and values within NUMBER_LIST."
        },
        "Enum": {
          "$ref": "#/$defs/ValidationEnum"
        }
      }
    },
    "ValidationEnum": {
      "type": "object",
      "properties": {
        "Strict": {
          "type": "boolean",
          "description": "Boolean that defaults to false. When true, only values specified in the enum list are allowed. When false, custom values beyond the enumerated list are permitted."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of predefined values that are allowed for this attribute. These values are always permitted regardless of the Strict setting."
        }
      }
    }
  }
}