Validate a two-factor code

GET https://api.cryptohopper.com/v1/user/validatetwofactor

Checks a two-factor authentication code of the user. A wrong code returns HTTP 400 with "Invalid 2FA code."

OAuth scope: user About scopes

A valid emergency one-time password is used up by this call. Accounts without two-factor authentication accept any non-empty code.

Example request

curl "https://api.cryptohopper.com/v1/user/validatetwofactor?code=CODE" \
  -H "access-token: YOUR_ACCESS_TOKEN"

Parameters

Headers

NameTypeRequiredDescription
access-token string Required The OAuth access token of the user.

Query parameters

NameTypeRequiredDescription
code string Required Current code from the user's authenticator app, or one of the user's emergency one-time passwords.

Response

Example response (illustrative values)

{
    "data": "Successfully authenticated."
}

Status codes: 200. Errors return JSON with status, error and message. See How the API works for response codes and rate limits.