Skip to content

Recover Account

This guide provides information on how to recover user’s account using the REST API.

This is the step for recovering the user’s account.

  1. You need to send the recovery code to the user’s email.

    Call POST account/recovery-code endpoint.

    Ensure that you include the following in the request body:

    {
    "email": "string"
    }

    After sending the request, the user should be able to receive the recovery code.

  2. Validate the recovery code

    After receiving the recovery code, you need to validate whether the recovery code has been used or has expired.

    To verify, call the POST account/verify-recovery-code/{recovery_code} endpoint.

    • If the recovery code is valid, the response will return a status code of 200 (OK).
    • If the recovery code is invalid or expired, the response will return a status code of 400 (Bad Request).
  3. Recover the account

    If the recovery code is valid, call the POST account/recover endpoint.

    Ensure that you include the following in the request body:

    {
    "recovery_code": 0,
    "email": "string",
    "password": "string" //New password
    }

    If everything goes well, the response status code will be 200 (OK). Redirect the user to the login page.