Skip to content
Get Started

List TOTP secrets

v2.totp.secrets.list() -> SecretListResponse
GET/api/v2/totp/secrets

List all stored TOTP secrets for the account. The encrypted secret values are never returned.

ReturnsExpand Collapse
class SecretListResponse:
status: Optional[str]
totp_secrets: Optional[List[TotpSecret]]
id: Optional[str]

Unique identifier for this TOTP secret

formatuuid
algorithm: Optional[Literal["SHA1", "SHA256", "SHA512"]]

Hash algorithm used

One of the following:
"SHA1"
"SHA256"
"SHA512"
created_at: Optional[datetime]
digits: Optional[int]

Code length (6 or 8)

issuer: Optional[str]

Service name

label: Optional[str]

Human-readable label

period: Optional[int]

Rotation period in seconds

secret: Optional[str]

Base32 secret — only returned on creation, never on list/get

List TOTP secrets

import os
from sendblue_api import SendblueAPI

client = SendblueAPI(
    api_key=os.environ.get("SENDBLUE_API_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SENDBLUE_API_API_SECRET"),  # This is the default and can be omitted
)
secrets = client.v2.totp.secrets.list()
print(secrets.status)
{
  "status": "OK",
  "totp_secrets": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "algorithm": "SHA1",
      "created_at": "2026-04-05T12:00:00Z",
      "digits": 6,
      "issuer": "GitHub",
      "label": "GitHub - [email protected]",
      "period": 30,
      "secret": "JBSWY3DPEHPK3PXP"
    }
  ]
}
Returns Examples
{
  "status": "OK",
  "totp_secrets": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "algorithm": "SHA1",
      "created_at": "2026-04-05T12:00:00Z",
      "digits": 6,
      "issuer": "GitHub",
      "label": "GitHub - [email protected]",
      "period": 30,
      "secret": "JBSWY3DPEHPK3PXP"
    }
  ]
}