POST /auth/totp

Enable TOTP (Time-based One-Time Password) authentication. It requires verification code from authenticator app.

application/json

Body Required

  • totp string Required

    TOTP verification code from authenticator app

Responses

  • 200

    TOTP enabled

  • 400

    TOTP already enabled or verification failed

POST /auth/totp
curl -X POST "http://api.example.com/auth/totp" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "totp": ""
}'
import requests

url = "http://api.example.com/auth/totp"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json"
}
params = {}
payload = {
    "totp": ""
}

response = requests.post(
    url,
    headers=headers,
    params=params,
    json=payload
)

response.raise_for_status()

if response.content:
    print(response.json())
curl \
 --request POST 'http://api.example.com/auth/totp' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"totp":"string"}'
Request examples
{
  "totp": "string"
}