add_custom_attributes
(**kwargs)¶Adds additional user attributes to the user pool schema.
See also: AWS API Documentation
Request Syntax
response = client.add_custom_attributes(
UserPoolId='string',
CustomAttributes=[
{
'Name': 'string',
'AttributeDataType': 'String'|'Number'|'DateTime'|'Boolean',
'DeveloperOnlyAttribute': True|False,
'Mutable': True|False,
'Required': True|False,
'NumberAttributeConstraints': {
'MinValue': 'string',
'MaxValue': 'string'
},
'StringAttributeConstraints': {
'MinLength': 'string',
'MaxLength': 'string'
}
},
]
)
[REQUIRED]
The user pool ID for the user pool where you want to add custom attributes.
[REQUIRED]
An array of custom attributes, such as Mutable and Name.
Contains information about the schema attribute.
A schema attribute of the name type.
The attribute data type.
Note
You should use WriteAttributes in the user pool client to control how attributes can be mutated for new use cases instead of using DeveloperOnlyAttribute
.
Specifies whether the attribute type is developer only. This attribute can only be modified by an administrator. Users won't be able to modify this attribute using their access token. For example, DeveloperOnlyAttribute
can be modified using AdminUpdateUserAttributes but can't be updated using UpdateUserAttributes.
Specifies whether the value of the attribute can be changed.
For any user pool attribute that is mapped to an IdP attribute, you must set this parameter to true
. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If an attribute is immutable, Amazon Cognito throws an error when it attempts to update the attribute. For more information, see Specifying Identity Provider Attribute Mappings for Your User Pool.
Specifies whether a user pool attribute is required. If the attribute is required and the user doesn't provide a value, registration or sign-in will fail.
Specifies the constraints for an attribute of the number type.
The minimum value of an attribute that is of the number data type.
The maximum value of an attribute that is of the number data type.
Specifies the constraints for an attribute of the string type.
The minimum length.
The maximum length.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response from the server for the request to add custom attributes.
Exceptions
CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException
CognitoIdentityProvider.Client.exceptions.InvalidParameterException
CognitoIdentityProvider.Client.exceptions.TooManyRequestsException
CognitoIdentityProvider.Client.exceptions.NotAuthorizedException
CognitoIdentityProvider.Client.exceptions.UserImportInProgressException
CognitoIdentityProvider.Client.exceptions.InternalErrorException