Pterodactyl API v1
Account

Enable 2FA

Enables TOTP 2FA using the QR code generated by the GET request

Uses code generated from GET /account/two-factor

POST/api/client/account/two-factor

Authorization

ClientToken
AuthorizationBearer <token>

Client API key (generated at /account/api)

In: header

Request Body

application/json

code*string

6-digit TOTP code from the authenticator app

Length6 <= length <= 6
password*string

Account password

Response Body

application/json

application/json

curl -X POST "https://pterodactyl.file.properties/api/client/account/two-factor" \  -H "Authorization: Bearer ptlc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \  -H "Accept: application/json" \  -H "Content-Type: application/json" \  -d '{  "code": "505134",  "password": "yourpassword"}'
{
  "object": "recovery_tokens",
  "attributes": {
    "tokens": [
      "MpBjHH8O08",
      "D9H0hktN6L",
      "ho8KiUpeV8",
      "06vZEfrYPf",
      "nFRySZ2ryh",
      "7K1cTrhGoV",
      "n6xpwwlJfv",
      "hAmyCsZxYO",
      "5FiMKFyNpH",
      "IViSFoRFvW"
    ]
  }
}
{
  "errors": [
    {
      "code": "TwoFactorAuthenticationTokenInvalid",
      "status": "400",
      "detail": "The token provided is not valid."
    }
  ]
}