> For a complete page index, fetch https://docs.transak.com/llms.txt

# Transak Auth

Transak verifies the user with a one-time password sent to their email address.

#### Send User OTP

Call [Send User OTP](/api/whitelabel/user/send-user-otp) with the user's **email address**. Transak sends a one-time password to the user's inbox.

#### Verify User OTP

Call [Verify User OTP](/api/whitelabel/user/verify-user-otp) with the following parameters:

<table>
  <tbody>
    <tr>
      <td>
        **`email`** `string` — required

        The user's email address

        ---

        **`otp`** `string` — required

        The one-time password from the user's inbox

        ---

        **`stateToken`** `string` — required

        Returned in the Send User OTP response

        ---
      </td>
    </tr>
  </tbody>
</table>

> **Save the Access Token**
>
> On success, store `data.accessToken`. This is the **User Access Token** required for all subsequent authenticated API calls.

#### Send the token on every call

Send the access token in the `authorization` header on its own, with no `Bearer` prefix. It is valid for 30 days.

#### Refresh the token before it expires

Call [Refresh User Access Token](/api/whitelabel/user/refresh-user-access-token) before the token expires. If it has already expired, log the user in again from **Send User OTP**.

#### Log the user out

Call [Logout User](/api/whitelabel/user/logout-user) when the user logs out of your app.

## Returning users

If you already have a stored access token, call [Get User Details](/api/whitelabel/user/get-user-details) with it. A `401` response means the token is missing, invalid or expired: log the user in again from **Send User OTP**.

## API Overview

#### [Send User OTP](/api/whitelabel/user/send-user-otp)

Emails a one-time password to the user.

#### [Verify User OTP](/api/whitelabel/user/verify-user-otp)

Verifies the OTP and returns the user's access token.

#### [Refresh User Access Token](/api/whitelabel/user/refresh-user-access-token)

Renews the user's access token before it expires.

#### [Logout User](/api/whitelabel/user/logout-user)

Logs the user out.

#### [Get User Details](/api/whitelabel/user/get-user-details)

Returns the user's profile and KYC status.

See [Error Codes](/api/whitelabel/error-codes) for the authentication errors (`10xx`) these APIs return.