Skip to main content
Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

TOTP API

Download OpenAPI (YAML)Version v1

Base URL: https://api.asgardeo.io/t/<ORGANIZATION_NAME>/api/users/v1

The WSO2 Identity Platform - TOTP API Definition (version v1).

Download the OpenAPI definition (YAML)

Security schemes​

OAuth2: oauth2

You can use the following OAuth grant type to securely access the respective API endpoints.

Authorization Code OAuth Flow

Authorization URL: 'https://api.asgardeo.io/t/{org-name}/oauth2/authorize'

This flow type is used for the me endpoint of TOTP APIs. You can use the following scope for this endpoints.

  • internal_login: Grant permission for an authenticated user for self management.

me​

Operations for the authenticated user.

Retrieve the QR Code URL​

GET /me/totp

This API is used to retrieve the QR code URL of the authenticated user.

Scope required:internal_login

Responses

CodeDescriptionSchema
200

OK

TOTPResponse
401

Unauthorized

403

Resource Forbidden

500

Server Error

Error

Generate, refresh and validate the QR​

POST /me/totp

This API is used to perform following actions.

<li><b>INIT</b>- Generate the TOTP QR code URL for the authenticated user.</li> <li><b>REFRESH</b> - Refresh the TOTP secret key of the authenticated user.</li> <li><b>VALIDATE</b> - Validate the user entered verification code.</li>

Scope required: internal_login

Responses

CodeDescriptionSchema
200

TOTP secret successfully refreshed

201

Created

TOTPResponse
400

Bad Request

Error
401

Unauthorized

403

Resource Forbidden

409

Conflict

Error
500

Server Error

Error

Reset TOTP credentials​

DEL /me/totp

This API is used to delete the TOTP credentials of the authenticated user.

Scope required:internal_login

Responses

CodeDescriptionSchema
200

Credentials deleted successfully

401

Unauthorized

403

Resource Forbidden

500

Server Error

Error

Retrieve the TOTP secret​

GET /me/totp/secret

This API is used to retrieve the TOTP secret of the authenticated user.

Scope required:internal_login

Responses

CodeDescriptionSchema
200

OK

TOTPSecretResponse
401

Unauthorized

403

Resource Forbidden

500

Server Error

Error

Schemas​

Error​

Type: object

4 properties
NameTypeRequiredDescription
codestringYes
messagestringYes
descriptionstring
traceIdstring

UserRequest​

Type: object

2 properties
NameTypeRequiredDescription
actionstringYes

Allowed values: INIT, REFRESH, VALIDATE

verificationCodeinteger

TOTPResponse​

Type: object

2 properties
NameTypeRequiredDescription
qrCodeUrlstring

QR Code URL for the authenticated user

isValidboolean

Secret key of the authenticated user

TOTPSecretResponse​

Type: object

1 property
NameTypeRequiredDescription
secretstring

Refreshed TOTP secret key of the authenticated user

Was this page helpful?