Skip to content

Random Password Generation

The Random Password Generation API provides operations to generate a random password.

Generate a random password

Request

OPA roles:
  • end_user

Generates a random password based on the request parameters provided

Security
bearerAuth
Path
team_namestringrequired

The name of your team

Bodyapplication/json
character_optionsobject(RandomPasswordCharacterOptions)required
num_charsintegerrequired

The desired length for the password

public_keyobject(RawJSONWebKey)required

A JSON Web Key formatted in accordance with RFC 7517.

POST
/v1/teams/{team_name}/random_password
curl -i -X POST \
  'https://{org_name}.pam.okta.com/v1/teams/{team_name}/random_password' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "character_options": {
      "digits": true,
      "lower_case": true,
      "special_characters": true,
      "upper_case": true
    },
    "num_chars": 0,
    "public_key": {
      "alg": "EdDSA",
      "crv": "Ed25519",
      "d": "string",
      "dp": "string",
      "dq": "string",
      "e": "string",
      "k": "string",
      "kid": "/regex/",
      "kty": "EC",
      "n": "string",
      "p": "string",
      "q": "string",
      "qi": "string",
      "use": "string",
      "x": "string",
      "x5c": [
        "string"
      ],
      "x5t": "string",
      "x5t#S256": "string",
      "x5u": "string",
      "y": "string"
    }
  }'

Responses

OK

Bodyapplication/json
password_jwestringrequired

The encrypted password as a fully serialized JWE

Response
{ "password_jwe": "string" }