Skip to content
Get Started

Get current TOTP code

GET/api/v2/totp/code/{secret_id}

Generate the current 6- or 8-digit TOTP code for a stored secret, along with how many seconds remain until it rotates.

Path ParametersExpand Collapse
secret_id: string
ReturnsExpand Collapse
code: optional string

The current TOTP code

expires_in: optional number

Seconds until this code rotates

status: optional string

Get current TOTP code

curl https://api.sendblue.co/api/v2/totp/code/$SECRET_ID \
    -H "sb-api-key-id: $SENDBLUE_API_API_KEY" \
    -H "sb-api-secret-key: $SENDBLUE_API_API_SECRET"
{
  "code": "482031",
  "expires_in": 14,
  "status": "OK"
}
Returns Examples
{
  "code": "482031",
  "expires_in": 14,
  "status": "OK"
}