v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1422123151.4 KB

Generates a random password. We recommend that you specify the maximum length and include every character type that the system you are generating a password for can support.

Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters because it might be logged. For more information, see Logging Secrets Manager events with CloudTrail.

Required permissions: secretsmanager:GetRandomPassword. For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager.

post/#X-Amz-Target=secretsmanager.GetRandomPassword

Headers

X-Amz-Target'secretsmanager.GetRandomPassword' required

Request body

PasswordLengthinteger

The length of the password. If you don't include this parameter, the default length is 32 characters.

ExcludeCharactersstring

A string of the characters that you don't want in the password.

ExcludeNumbersboolean

Specifies whether to exclude numbers from the password. If you don't include this switch, the password can contain numbers.

ExcludePunctuationboolean

Specifies whether to exclude the following punctuation characters from the password: <code>! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~</code>. If you don't include this switch, the password can contain punctuation.

ExcludeUppercaseboolean

Specifies whether to exclude uppercase letters from the password. If you don't include this switch, the password can contain uppercase letters.

ExcludeLowercaseboolean

Specifies whether to exclude lowercase letters from the password. If you don't include this switch, the password can contain lowercase letters.

IncludeSpaceboolean

Specifies whether to include the space character. If you include this switch, the password can contain space characters.

RequireEachIncludedTypeboolean

Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation. If you don't include this switch, the password contains at least one of every character type.

Response

Success

RandomPasswordstring password

A string with the password.

Example response

{
  "RandomPassword": "EXAMPLE-PASSWORD"
}