1. Docs
  2. API Reference
  3. Begin TOTP factor enrollment

Begin TOTP factor enrollment

POST/v1/identity/auth/mfa/totp/enroll/start

Authentication

  • Bearer Token Authorization

    JWT access token

Code samples

cURLJavaScriptPythonGo
curl -X POST "https://api.canopy.dev/v1/identity/auth/mfa/totp/enroll/start" \
  -H "Authorization: Bearer $CANOPY_TOKEN"

Responses

200 Generates a provisional TOTP secret, the `otpauth://` URI for the authenticator app, a base64 QR data URL, and a short-lived sealed `enrollment_token` that must be returned to the verify endpoint within 5 minutes. The factor row is NOT created until verify succeeds.
{
  "enrollment_token": "string",
  "otpauth_uri": "otpauth://totp/MFA:alice%40acme.com?secret=JBSWY3DPEHPK3PXP&issuer=MFA",
  "manual_entry_key": "JBSWY3DPEHPK3PXP"
}

application/json

  • enrollment_tokenstring*

    Opaque short-lived (5 min) sealed token carrying the provisional TOTP secret. Must be returned to the verify endpoint exactly.

  • otpauth_uristring*

    `otpauth://totp/...` URI for the authenticator app to import. Render as a QR code on the client.

  • manual_entry_keystring*

    Human-readable fallback for users who can't scan the QR. Base32-encoded secret string.

401 Invalid or expired token
403 This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)

Returned object

On this page

Related endpoints

GETList enrolled MFA factors for the caller
POSTComplete TOTP factor enrollment
POSTBegin WebAuthn factor enrollment
POSTComplete WebAuthn factor enrollment
POSTProve a fresh factor to authorise a sensitive MFA mutation
POSTBegin a WebAuthn-backed step-up ceremony
POSTComplete a WebAuthn step-up ceremony
DELETERemove an enrolled MFA factor
POSTRegenerate the identity's single-use recovery codes
GETList the identity's active 'remember this device' records
DELETERevoke every trusted device for the caller
DELETERevoke a single trusted device