iam.users.update-login-profile

Reset, unlock, or turn on/off an IAM user's console password

PATCH /iam/api/users/{id}/login-profileIAM iam:UpdateLoginProfileChanges stateDestructive

A new password ends the user’s sessions and, unless `passwordResetRequired: false`, must be changed at the next sign-in. `enabled: false` ends their sessions at once.

Request syntax

PATCH /iam/api/users/{id}/login-profile
{
  "password": "string",
  "generatePassword": "boolean",
  "passwordResetRequired": "boolean",
  "enabled": "boolean",
  "unlock": "boolean"
}

Path parameters

  • idRequired

    string

    Constraints: uuid

Request body

  • passwordOptional

    string

    A new password, checked against the organization's password policy; ends the user's sessions

    Constraints: 1-256 chars

  • generatePasswordOptional

    boolean

    true: a new password is made for you and returned once, in generatedPassword; ends the user's sessions

  • passwordResetRequiredOptional

    boolean

    The user must choose a new password at the next sign-in; with a new password, default true

  • enabledOptional

    boolean

    false turns console sign-in off and ends the user's sessions at once (the password is kept); true turns it on again

  • unlockOptional

    boolean

    true lifts a lockout after too many wrong passwords

Response

200 with the console access as get-login-profile shows it, plus generatedPassword: a password made for you, shown only this once (otherwise null).

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow iam:UpdateLoginProfile on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud iam users update-login-profile id

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_iam_users_update-login-profile.