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

Set the two-factor policy

When on, each local user without TOTP must enrol at the next login. Open sessions continue.

PUT/api/v1/two-factor-policy
Authorization
tse_sessionAPI key · cookierequired
Request body
requiredapplication/json
require_two_factorbooleanrequired

Each local user without TOTP must enrol at the next login

Responses
200

OK

require_two_factorbooleanrequired

Each local user without TOTP must enrol at the next login

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 PUT 'https://console.example.com/api/v1/two-factor-policy' \
  -H 'Cookie: tse_session=YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "require_two_factor": true
}'
Response
{
  "require_two_factor": true
}