---
title: "Generate TOTP code"
method: POST
path: "/v1beta/secrets/{id}/totp"
tags: ["Secrets"]
---

# Generate TOTP code

`POST /v1beta/secrets/{id}/totp`

## Request

- Base URL: `https://api.indices.io`
- URL: `https://api.indices.io/v1beta/secrets/{id}/totp`
- Auth: HTTP bearer

Generate a current TOTP code for a login secret that has 2FA configured.

## Path parameters

- `id` string, required: The ID of the secret.

## Response `200`

Successful response

- TotpResponse
  - `id` string, required: Unique identifier of the secret.
  - `code` string, required: Current 6-digit TOTP code.

## Other responses

- `422`: Validation error

---

[API](https://skmtc.dev/indices/apis/indices-api.md) · [All operations](https://skmtc.dev/indices/apis/indices-api/llms.txt) · [OpenAPI document](https://skmtc.dev/indices/apis/indices-api/revisions/e0f2742c126c?raw)
