updatePassword

// Update a password with the old password
client.updatePassword({
  password: string,
  // Optional fields
  accessToken: string,
  oldPassword: string
})

// Update a password with the email
client.updatePassword({
  email: string,
  verificationCode: string,
  password: string,
  // Optional fields
  accessToken: string
})

// Update a password with the phone number
client.updatePassword({
  phoneNumber: string,
  verificationCode: string,
  password: string,
  // Optional fields
  accessToken: string
})

About this command

Update the profile’s password. The parameters required in addition to the new password are either:

  • A fresh access token (less than 5 minutes old).

  • An access token and the old password.

  • The profile’s email address/phone number and the verification code sent by email/SMS through a request password reset flow.

  • The profile must have been granted the full_write scope at the last authentication.

Examples

  • With an AT

  • With a fresh AT

  • With an email

  • With a phone number

client.updatePassword({
  accessToken: 'eyJ0eXAiOiJKV1QiL...',
  password: 'ZPf7LFtc',
  oldPassword: 'gVc7piBn'
})
client.updatePassword({
  accessToken: 'eyJ0eXAiOiJKV1QiL...',
  password: 'ZPf7LFtc'
})
client.updatePassword({
  email: 'john.doe@example.com',
  verificationCode: '234',
  password: 'ZPf7LFtc'
})
client.updatePassword({
  phoneNumber: '+33682234940',
  verificationCode: '234',
  password: 'ZPf7LFtc'
})

Parameters

accessToken string

The authorization credential JSON Web Token (JWT) used to access the ReachFive API.

password string

The user’s password.

oldPassword string

The old password of the profile.

verificationCode string

The verification code sent by email or SMS.

email string

The user’s email address.

phoneNumber string

The user’s phone number.

Both the international format and the national conventions of the account’s country are accepted if configured in account settings.

Response

Type: Promise[void]