> For the complete documentation index, see [llms.txt](https://docs.vida.id/identity-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vida.id/identity-stack/authentication/authentication-factors/totp-time-based-otp-api/api-reference.md).

# API Reference

### TOTP-Based Authentication APIs

These APIs enable TOTP (Time-based One-Time Password) authentication using authenticator apps like Google Authenticator. The process is divided into **Initiation** and **Completion** phases for both provisioning and authentication.

| Phase          | API Name                       | Description                                                                                                       | API Reference Link                                                                                                                                     |
| -------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Initiation** | TOTP Provisioning Initiation   | Begins the TOTP provisioning process. Returns a session ID, bearer token, and a TOTP secret as part of challenge. | [View API](/identity-stack/authentication/authentication-factors/totp-time-based-otp-api/api-reference/otp-initiation.md#totp-provisioning)            |
|                | TOTP Authentication Initiation | Initiates authentication using TOTP. Returns a session ID, bearer token, and a challenge.                         | [View API](/identity-stack/authentication/authentication-factors/totp-time-based-otp-api/api-reference/otp-initiation.md#totp-authentication-api)      |
| **Completion** | TOTP Provisioning Completion   | Completes provisioning by verifying the OTP generated from the shared TOTP secret. Returns JWT and credential ID. | [View API](/identity-stack/authentication/authentication-factors/totp-time-based-otp-api/api-reference/otp-completion.md#totp-provisioning-completion) |
|                | TOTP Authentication Completion | Completes authentication by validating the OTP provided by the user. Returns access tokens upon success.          | [View API](/identity-stack/authentication/authentication-factors/totp-time-based-otp-api/api-reference/otp-completion.md#totp-authentication-api)      |
