Skip to content
TimescaleDB Enterprise
Esc
↑↓navigate↵open⌘Jpreview

Confirm TOTP enrolment

Turns two-factor on and returns 10 recovery codes once. Ends the other sessions of the user and sets a new session cookie. A wrong code keeps the secret pending.

POST/api/v1/auth/two-factor/enrolment/confirm
Authorization
tse_sessionAPI key · cookierequired
Header parameters
X-Forwarded-Protostring
Request body
requiredapplication/json
codestring

The 6-digit code of the authenticator app

Responses
200

OK

recovery_codesstring[]required

Shown once. Each code works once.

default

Error

codestring

Stable code of the refusal, when the route has codes

detailsstring[]

Additional detail, e.g. per-field validation failures

errorstringrequired

Human-readable error message

Request
curl -X POST 'https://console.example.com/api/v1/auth/two-factor/enrolment/confirm' \
  -H 'Cookie: tse_session=YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "code": "string"
}'
Response
{
  "recovery_codes": [
    "string"
  ]
}