CreateDataTableAttribute
Adds an attribute to an existing data table. Creating a new primary attribute uses the empty value for the specified value type for all existing records. This should not affect uniqueness of published data tables since the existing primary values will already be unique. Creating attributes does not create any values. System managed tables may not allow customers to create new attributes.
Request Syntax
PUT /data-tables/InstanceId/DataTableId/attributes HTTP/1.1
Content-type: application/json
{
"Description": "string",
"Name": "string",
"Primary": boolean,
"Validation": {
"Enum": {
"Strict": boolean,
"Values": [ "string" ]
},
"ExclusiveMaximum": number,
"ExclusiveMinimum": number,
"IgnoreCase": boolean,
"Maximum": number,
"MaxLength": number,
"MaxValues": number,
"Minimum": number,
"MinLength": number,
"MinValues": number,
"MultipleOf": number
},
"ValueType": "string"
}
URI Request Parameters
The request uses the following URI parameters.
- DataTableId
-
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.
Length Constraints: Minimum length of 1. Maximum length of 256.
Required: Yes
- InstanceId
-
The unique identifier for the Amazon Connect instance.
Length Constraints: Minimum length of 1. Maximum length of 100.
Required: Yes
Request Body
The request accepts the following data in JSON format.
- Description
-
An optional description for the attribute. Must conform to Connect human readable string specification and have 0-250 characters. Whitespace trimmed before persisting.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 250.
Pattern:
^[\\P{C}\r\n\t]+$Required: No
- Name
-
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.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 127.
Pattern:
^[\p{L}\p{Z}\p{N}\-_.:=@'|]+$Required: Yes
- Primary
-
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.
Type: Boolean
Required: No
- Validation
-
Optional validation rules for the attribute. Borrows heavily from JSON Schema - Draft 2020-12. The maximum length of arrays within validations and depth of validations is 5. There are default limits that apply to all types. Customer specified limits in excess of the default limits are not permitted.
Type: Validation object
Required: No
- ValueType
-
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.
Type: String
Valid Values:
TEXT | NUMBER | BOOLEAN | TEXT_LIST | NUMBER_LISTRequired: Yes
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"AttributeId": "string",
"LockVersion": {
"Attribute": "string",
"DataTable": "string",
"PrimaryValues": "string",
"Value": "string"
},
"Name": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- AttributeId
-
The unique identifier assigned to the created attribute.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
- LockVersion
-
The lock version information for the data table and attribute, used for optimistic locking and versioning.
Type: DataTableLockVersion object
- Name
-
The name of the created attribute since it also serves as the identifier. This could be different than the parameter passed in since it will be trimmed for whitespace.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 127.
Pattern:
^[\p{L}\p{Z}\p{N}\-_.:=@'|]+$
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You do not have sufficient permissions to perform this action.
HTTP Status Code: 403
- ConflictException
-
Operation cannot be performed at this time as there is a conflict with another operation or contact state.
HTTP Status Code: 409
- DuplicateResourceException
-
A resource with the specified name already exists.
HTTP Status Code: 409
- InternalServiceException
-
Request processing failed because of an error or failure with the service.
- Message
-
The message.
HTTP Status Code: 500
- InvalidParameterException
-
One or more of the specified parameters are not valid.
- Message
-
The message about the parameters.
HTTP Status Code: 400
- InvalidRequestException
-
The request is not valid.
- Message
-
The message about the request.
- Reason
-
Reason why the request was invalid.
HTTP Status Code: 400
- ResourceNotFoundException
-
The specified resource was not found.
- Message
-
The message about the resource.
HTTP Status Code: 404
- ServiceQuotaExceededException
-
The service quota has been exceeded.
- Reason
-
The reason for the exception.
HTTP Status Code: 402
- ThrottlingException
-
The throttling limit has been exceeded.
HTTP Status Code: 429
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: