/gate/mfa/totp/enrollEnroll TOTP
Initiates TOTP (time-based one-time password) MFA enrollment for the authenticated end-user, returning a provisioning QR code and the raw TOTP secret for scanning with an authenticator app.
Ten single-use recovery codes are generated at this step and must be saved before enrollment is confirmed.
Enrollment is not active until confirmed via the confirm endpoint.
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| label | string | A name for the authenticator, shown in the methods list. Default |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 401 | K9O_SESSION_EXPIRED | Your session has expired or been revoked. Sign in again to continue. |
| 404 | K9O_END_USER_NOT_FOUND | No account was found for the provided identity. |
| data * | object | The authenticator app that was enrolled. |
| factor * | object | The new, unconfirmed authenticator. Confirm it with a code from the app. |
| id * | string | The authenticator's id ( |
| secret * | string | The TOTP seed, base32. It is shown only in this response and is never readable again: show it (or The authenticator is unusable until confirmed. |
| uri * | string | An Render it as a QR code for the authenticator app to scan. |
| meta * | any | Request metadata: cost, timing and the request and trace ids. |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.gate.mfa.totp.enroll({
label: 'string'
})Showing example in TypeScript
{
"label": "string"
}{
"data": {
"factor": {
"id": "string",
"secret": "string",
"uri": "string"
}
}
}