Menu
Amazon Cognito Identity Provider
API Reference (API Version 2016-04-18)

UpdateUserPool

Updates the specified user pool with the specified attributes.

Request Syntax

{
   "AdminCreateUserConfig": { 
      "AllowAdminCreateUserOnly": boolean,
      "InviteMessageTemplate": { 
         "EmailMessage": "string",
         "EmailSubject": "string",
         "SMSMessage": "string"
      },
      "UnusedAccountValidityDays": number
   },
   "AutoVerifiedAttributes": [ "string" ],
   "DeviceConfiguration": { 
      "ChallengeRequiredOnNewDevice": boolean,
      "DeviceOnlyRememberedOnUserPrompt": boolean
   },
   "EmailConfiguration": { 
      "ReplyToEmailAddress": "string",
      "SourceArn": "string"
   },
   "EmailVerificationMessage": "string",
   "EmailVerificationSubject": "string",
   "LambdaConfig": { 
      "CreateAuthChallenge": "string",
      "CustomMessage": "string",
      "DefineAuthChallenge": "string",
      "PostAuthentication": "string",
      "PostConfirmation": "string",
      "PreAuthentication": "string",
      "PreSignUp": "string",
      "PreTokenGeneration": "string",
      "VerifyAuthChallengeResponse": "string"
   },
   "MfaConfiguration": "string",
   "Policies": { 
      "PasswordPolicy": { 
         "MinimumLength": number,
         "RequireLowercase": boolean,
         "RequireNumbers": boolean,
         "RequireSymbols": boolean,
         "RequireUppercase": boolean
      }
   },
   "SmsAuthenticationMessage": "string",
   "SmsConfiguration": { 
      "ExternalId": "string",
      "SnsCallerArn": "string"
   },
   "SmsVerificationMessage": "string",
   "UserPoolAddOns": { 
      "AdvancedSecurityMode": "string"
   },
   "UserPoolId": "string",
   "UserPoolTags": { 
      "string" : "string" 
   },
   "VerificationMessageTemplate": { 
      "DefaultEmailOption": "string",
      "EmailMessage": "string",
      "EmailMessageByLink": "string",
      "EmailSubject": "string",
      "EmailSubjectByLink": "string",
      "SmsMessage": "string"
   }
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

AdminCreateUserConfig

The configuration for AdminCreateUser requests.

Type: AdminCreateUserConfigType object

Required: No

AutoVerifiedAttributes

The attributes that are automatically verified when the Amazon Cognito service makes a request to update user pools.

Type: Array of strings

Valid Values: phone_number | email

Required: No

DeviceConfiguration

Device configuration.

Type: DeviceConfigurationType object

Required: No

EmailConfiguration

Email configuration.

Type: EmailConfigurationType object

Required: No

EmailVerificationMessage

The contents of the email verification message.

Type: String

Length Constraints: Minimum length of 6. Maximum length of 20000.

Pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}\s*]*\{####\}[\p{L}\p{M}\p{S}\p{N}\p{P}\s*]*

Required: No

EmailVerificationSubject

The subject of the email verification message.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 140.

Pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}\s]+

Required: No

LambdaConfig

The AWS Lambda configuration information from the request to update the user pool.

Type: LambdaConfigType object

Required: No

MfaConfiguration

Can be one of the following values:

  • OFF - MFA tokens are not required and cannot be specified during user registration.

  • ON - MFA tokens are required for all user registrations. You can only specify required when you are initially creating a user pool.

  • OPTIONAL - Users have the option when registering to create an MFA token.

Type: String

Valid Values: OFF | ON | OPTIONAL

Required: No

Policies

A container with the policies you wish to update in a user pool.

Type: UserPoolPolicyType object

Required: No

SmsAuthenticationMessage

The contents of the SMS authentication message.

Type: String

Length Constraints: Minimum length of 6. Maximum length of 140.

Pattern: .*\{####\}.*

Required: No

SmsConfiguration

SMS configuration.

Type: SmsConfigurationType object

Required: No

SmsVerificationMessage

A container with information about the SMS verification message.

Type: String

Length Constraints: Minimum length of 6. Maximum length of 140.

Pattern: .*\{####\}.*

Required: No

UserPoolAddOns

Used to enable advanced security risk detection. Set the key AdvancedSecurityMode to the value "AUDIT".

Type: UserPoolAddOnsType object

Required: No

UserPoolId

The user pool ID for the user pool you want to update.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 55.

Pattern: [\w-]+_[0-9a-zA-Z]+

Required: Yes

UserPoolTags

The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool

Type: String to string map

Required: No

VerificationMessageTemplate

The template for verification messages.

Type: VerificationMessageTemplateType object

Required: No

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

ConcurrentModificationException

This exception is thrown if two or more modifications are happening concurrently.

HTTP Status Code: 400

InternalErrorException

This exception is thrown when Amazon Cognito encounters an internal error.

HTTP Status Code: 500

InvalidEmailRoleAccessPolicyException

This exception is thrown when Amazon Cognito is not allowed to use your email identity. HTTP status code: 400.

HTTP Status Code: 400

InvalidParameterException

This exception is thrown when the Amazon Cognito service encounters an invalid parameter.

HTTP Status Code: 400

InvalidSmsRoleAccessPolicyException

This exception is returned when the role provided for SMS configuration does not have permission to publish using Amazon SNS.

HTTP Status Code: 400

InvalidSmsRoleTrustRelationshipException

This exception is thrown when the trust relationship is invalid for the role provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com or the external ID provided in the role does not match what is provided in the SMS configuration for the user pool.

HTTP Status Code: 400

NotAuthorizedException

This exception is thrown when a user is not authorized.

HTTP Status Code: 400

ResourceNotFoundException

This exception is thrown when the Amazon Cognito service cannot find the requested resource.

HTTP Status Code: 400

TooManyRequestsException

This exception is thrown when the user has made too many requests for a given operation.

HTTP Status Code: 400

UserImportInProgressException

This exception is thrown when you are trying to modify a user pool while a user import job is in progress for that pool.

HTTP Status Code: 400

UserPoolTaggingException

This exception is thrown when a user pool tag cannot be set or updated.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: