Users

Set new login for loggedin user. It sends an email or SMS (depends on login type) with a pin code to new login.

PUT change login

Endpoint

PUT api/v1/users/change_login

Parameters

Name Description
user[new_login] required New email or phone number
user[reset_password_token] required Reset password token

Request

Route

PUT api/v1/users/change_login

Headers

Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxOTQyIiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzYzNjI2NDE2LCJleHAiOjE3NjYyMTg0MTYsImp0aSI6IjVhYjc1OGZjLWI4MjUtNDRjMi1iYmZjLTlhYTFkYzZjMTdkOSJ9.ukWcQIneLiK9rrFk259iiuuWcYbuxnvDEAEOhcUpnl0
Host: example.org
Cookie: 

Body

{
  "user": {
    "new_login": "+4407472930539",
    "reset_password_token": "L9nWdrFx3StK_XRX9a7A"
  }
}

Response

Simulated Response

Status

400

Headers

x-frame-options: SAMEORIGIN
x-xss-protection: 0
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
content-type: application/json; charset=utf-8
vary: Accept, Origin
cache-control: no-cache
x-request-id: f02f8f3b-fa79-4450-bfcd-63fa54ec84fa
x-runtime: 0.006985
content-length: 309

Body

{
  "user": {
    "id": 1942,
    "company": null,
    "contact_phone_number": null,
    "email": "kendall.langosh+operator@example.com",
    "financial_company_id": null,
    "first_name": "Kendall",
    "job_position": null,
    "last_name": "Langosh",
    "phone_number": null,
    "profile_id": null,
    "role": "operator"
  },
  "errors": {
    "new_login": [
      "has already been taken"
    ]
  }
}