Skip to content
v3.0.1 — MCP OAuth, organizations, passkeys, SSR adaptersChangelog
Convex Auth
Esc
↑↓navigate↵open⌘Jpreview

Begin TOTP enrollment

POST/api/auth/two-factor/enable
Request body
requiredapplication/json
passwordstringrequired
issuerstring
Responses
200

TOTP secret + otpauth:// URI for the authenticator app.

successbooleanrequired
Allowed:true
tokenstring

Access token (also delivered via Set-Cookie in cookie mode).

refreshTokenstring

Rotation token for /api/auth/update-session.

redirectboolean

Whether url should be navigated to.

urlstring

Validated landing URL.

userUser
Show properties
idstring
emailstring<email>
namestring
imagestring
emailVerifiedboolean
400

Invalid body or an untrusted redirect parameter.

successbooleanrequired
Allowed:false
reasonstringrequired
403

Cross-site request rejected by CSRF validation (Fetch Metadata / Origin). Same-origin and explicitly trusted origins are unaffected.

successbooleanrequired
Allowed:false
reasonstringrequired
Try it
Server
Bodyapplication/json
Request
curl -X POST 'https://your-deployment.convex.site/api/auth/two-factor/enable' \
  -H 'Content-Type: application/json' \
  -d '{
  "password": "string",
  "issuer": "string"
}'
Response
{
  "success": true,
  "token": "string",
  "refreshToken": "string",
  "redirect": true,
  "url": "string",
  "user": {
    "id": "string",
    "email": "user@example.com",
    "name": "string",
    "image": "string",
    "emailVerified": true
  }
}